use warnings;
use strict;
-use List::Util 'first';
-use namespace::clean;
-
# constants are used not only here, but also in comparison tests
sub __rows_bindtype () {
+{ sqlt_datatype => 'integer' }
=head2 LimitXY
- SELECT ... LIMIT $offset $limit
+ SELECT ... LIMIT $offset, $limit
Supported by B<MySQL> and any L<SQL::Statement> based DBD
SELECT SKIP $offset FIRST $limit * FROM ...
-Suported by B<Informix>, almost like LimitOffset. According to
+Supported by B<Informix>, almost like LimitOffset. According to
L<SQL::Abstract::Limit> C<... SKIP $offset LIMIT $limit ...> is also supported.
=cut
# method, and the slower BETWEEN query is used instead
#
# FIXME - this is quite expensive, and does not perform caching of any sort
- # as soon as some of the DQ work becomes viable consider switching this
- # over
+ # as soon as some of the SQLA-inlining work becomes viable consider adding
+ # some rudimentary caching support
if (
$rs_attrs->{order_by}
and
- $rs_attrs->{result_source}->storage->_order_by_is_stable(
+ $rs_attrs->{result_source}->schema->storage->_order_by_is_stable(
@{$rs_attrs}{qw/from order_by where/}
)
) {
. 'main-table-based order criteria.'
) unless $rs_attrs->{order_by};
- my $usable_order_colinfo = $main_rsrc->storage->_extract_colinfo_of_stable_main_source_order_by_portion(
+ my $usable_order_colinfo = $main_rsrc->schema->storage->_extract_colinfo_of_stable_main_source_order_by_portion(
$rs_attrs
);
my $s = $rs_attrs->{select}[$i];
my $sql_alias = (ref $s) eq 'HASH' ? $s->{-as} : undef;
- # we throw away the @bind here deliberately
- my ($sql_sel) = $self->_recurse_fields ($s);
+ my ($sql_sel) = length ref $s
+ # we throw away the @bind here deliberately
+ ? $self->_recurse_fields( $s )
+ : $self->_quote( $s )
+ ;
push @sel, {
arg => $s,
sql => $sql_sel,
- unquoted_sql => do {
- local $self->{quote_char};
- ($self->_recurse_fields ($s))[0]; # ignore binds again
- },
+ unquoted_sql => ( length ref $s
+ ? do {
+ local $self->{quote_char};
+ ($self->_recurse_fields ($s))[0]; # ignore binds again
+ }
+ : $s
+ ),
as =>
$sql_alias
||
return $fqcn;
}
-1;
-
-=head1 AUTHORS
+=head1 FURTHER QUESTIONS?
-See L<DBIx::Class/CONTRIBUTORS>.
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
-=head1 LICENSE
+=head1 COPYRIGHT AND LICENSE
-You may distribute this code under the same terms as Perl itself.
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
=cut
+
+1;