| Jifty-DBI documentation | Contained in the Jifty-DBI distribution. |
Jifty::DBI::Handle::ODBC - An ODBC specific Handle object
This module provides a subclass of Jifty::DBI::Handle that compensates for some of the idiosyncrasies of ODBC.
Returns a false value.
Audrey Tang cpan@audreyt.org
| Jifty-DBI documentation | Contained in the Jifty-DBI distribution. |
package Jifty::DBI::Handle::ODBC; use Jifty::DBI::Handle; @ISA = qw(Jifty::DBI::Handle); use vars qw($VERSION @ISA $DBIHandle $DEBUG); use strict;
sub case_sensitive { my $self = shift; return (undef); }
sub build_dsn { my $self = shift; my %args = ( driver => undef, database => undef, host => undef, port => undef, @_ ); $args{dbname} ||= delete $args{database}; my $dsn = "dbi:$args{driver}:$args{dbname}"; $dsn .= ";host=$args{'host'}" if $args{'host'}; $dsn .= ";port=$args{'port'}" if $args{'port'}; $self->{'dsn'} = $dsn; }
sub apply_limits { my $self = shift; my $statementref = shift; my $per_page = shift or return; my $first = shift; my $limit_clause = " TOP $per_page"; $limit_clause .= " OFFSET $first" if $first; $$statementref =~ s/SELECT\b/SELECT $limit_clause/; }
sub distinct_query { my $self = shift; my $statementref = shift; my $collection = shift; $$statementref = "SELECT main.* FROM $$statementref"; $$statementref .= $collection->_group_clause; $$statementref .= $collection->_order_clause; }
sub encoding { } 1; __END__