Sybase/SQLMaker.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Sybase/Diff.pm ↑ Summary
1 package DBIO::Sybase::SQLMaker;
2 # ABSTRACT: Sybase ASE-specific SQL generation for DBIO
3  
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use base qw( DBIO::SQLMaker );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9  
10  
11 3 ▶sub apply_limit {
Subroutine apply_limit: called CC=1 SCAR=0.0
Pod documented
12 3 my ($self, $sql, $rs_attrs, $rows, $offset) = @_;
13 3 return $self->_GenericSubQ($sql, $rs_attrs, $rows, $offset);
14 }
15  
16  
17 1 1;
18  
19 __END__
20  
21 =pod
22  
23 =encoding UTF-8
24  
25 =head1 NAME
26  
27 DBIO::Sybase::SQLMaker - Sybase ASE-specific SQL generation for DBIO
28  
29 =head1 VERSION
30  
31 version 0.900001
32  
33 =head1 DESCRIPTION
34  
35 L<DBIO::SQLMaker> subclass for Sybase ASE (Adaptive Server Enterprise).
36 ASE has no native C<LIMIT>/C<OFFSET> keyword, so this class overrides
37 L</apply_limit> to emit ASE-valid pagination.
38  
39 Used automatically by L<DBIO::Sybase::Storage::ASE>.
40  
41 =head1 METHODS
42  
43 =head2 apply_limit
44  
45 my $sql = $sqlmaker->apply_limit($sql, $rs_attrs, $rows, $offset);
46  
47 ASE has no C<LIMIT>/C<OFFSET> keyword. DBIO targets the database-agnostic
48 C<GenericSubQ> dialect: the query is sliced by a correlated
49 C<WHERE ( SELECT COUNT(*) ... ) BETWEEN ? AND ?> subquery against a stable,
50 main-table-based order. This is the same dialect DBIx::Class used for ASE,
51 because ASE has no single windowing/C<TOP> construct that works reliably for
52 all query shapes across server versions. Replaces the DBIx::Class
53 C<sql_limit_dialect> string dispatch.
54  
55 The C<rows>-only case (no offset) never reaches this method: it is handled
56 earlier by L<DBIO::Sybase::Storage::ASE/_prep_for_execute> via
57 C<SET ROWCOUNT>, which strips the limit before this SQLMaker runs.
58  
59 GenericSubQ requires a stable, main-table-based C<order_by>; a resultset with
60 an offset but no such order raises an exception (this is intentional, see
61 L<DBIO::SQLMaker::ClassicExtensions/_GenericSubQ>).
62  
63 =head1 SEE ALSO
64  
65 =over
66  
67 =item * L<DBIO::Sybase::Storage::ASE> - Sybase ASE storage (uses this SQL maker)
68  
69 =item * L<DBIO::SQLMaker> - Base SQL maker class
70  
71 =back
72  
73 =head1 AUTHOR
74  
75 DBIO & DBIx::Class Authors
76  
77 =head1 COPYRIGHT AND LICENSE
78  
79 Copyright (C) 2026 DBIO Authors
80 Portions Copyright (C) 2005-2025 DBIx::Class Authors
81 Based on DBIx::Class, heavily modified.
82  
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85  
86 =cut
« Sybase/Diff.pm ↑ Summary