NAME

DBIO::MySQL::SQLMaker - MySQL-specific SQL generation for DBIO

VERSION

version 0.900000

SYNOPSIS

# Used automatically by DBIO::MySQL::Storage — no manual setup needed.

DESCRIPTION

MySQL-specific SQL generation layer for DBIO. Extends DBIO::SQLMaker with the following MySQL adaptations:

  • INSERT with no columns emits INSERT INTO t () VALUES () instead of the standard INSERT INTO t DEFAULT VALUES, which MySQL does not support.

  • Supports STRAIGHT_JOIN as a join type hint via the join_type result source attribute.

  • UPDATE and DELETE statements that reference the modification target table in a subquery are automatically wrapped in a double subquery to work around MySQL's restriction against self-referencing in DML.

  • Implements MySQL's SELECT ... FOR UPDATE / FOR SHARE locking syntax, including the OF tbl_name, NOWAIT, and SKIP LOCKED clauses introduced in MySQL 8.0.1.

METHODS

apply_limit

Uses MySQL's LIMIT [offset,] rows syntax instead of the standard LIMIT rows OFFSET offset.

insert

Overrides the standard INSERT to emit INSERT INTO t () VALUES () for rows with no column values, satisfying MySQL's syntax requirements.

update

delete

Overrides the base update and delete methods. When the modification target table is referenced in a subquery within the same statement (a pattern MySQL rejects), the affected subquery is automatically re-wrapped in an additional SELECT * FROM (...) `_forced_double_subquery` layer to satisfy MySQL's parser.

_lock_select

Generates the locking clause appended to SELECT statements. Accepts either a plain string ('update', 'share') or a hashref for fine-grained control:

$rs->search({}, { for => { type => 'update', of => ['tbl'], modifier => 'nowait' } });

Valid type values: update, share. Valid modifier values: nowait, skip_locked. The of key takes a table name or arrayref of table names.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 285:

Unknown directive: =seealso