NAME

DBIO::Sybase::SQLMaker - Sybase ASE-specific SQL generation for DBIO

VERSION

version 0.900000

DESCRIPTION

DBIO::SQLMaker subclass for Sybase ASE (Adaptive Server Enterprise). ASE has no native LIMIT/OFFSET keyword, so this class overrides "apply_limit" to emit ASE-valid pagination.

Used automatically by DBIO::Sybase::Storage::ASE.

METHODS

apply_limit

my $sql = $sqlmaker->apply_limit($sql, $rs_attrs, $rows, $offset);

ASE has no LIMIT/OFFSET keyword. DBIO targets the database-agnostic GenericSubQ dialect: the query is sliced by a correlated WHERE ( SELECT COUNT(*) ... ) BETWEEN ? AND ? subquery against a stable, main-table-based order. This is the same dialect DBIx::Class used for ASE, because ASE has no single windowing/TOP construct that works reliably for all query shapes across server versions. Replaces the DBIx::Class sql_limit_dialect string dispatch.

The rows-only case (no offset) never reaches this method: it is handled earlier by "_prep_for_execute" in DBIO::Sybase::Storage::ASE via SET ROWCOUNT, which strips the limit before this SQLMaker runs.

GenericSubQ requires a stable, main-table-based order_by; a resultset with an offset but no such order raises an exception (this is intentional, see "_GenericSubQ" in DBIO::SQLMaker::ClassicExtensions).

SEE ALSO

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.