Jifty::DBI::Handle::ODBC - An ODBC specific Handle object


Jifty-DBI documentation Contained in the Jifty-DBI distribution.

Index


Code Index:

NAME

Top

  Jifty::DBI::Handle::ODBC - An ODBC specific Handle object

SYNOPSIS

Top

DESCRIPTION

Top

This module provides a subclass of Jifty::DBI::Handle that compensates for some of the idiosyncrasies of ODBC.

METHODS

Top

case_sensitive

Returns a false value.

build_dsn

apply_limits

distinct_query

encoding

AUTHOR

Top

Audrey Tang cpan@audreyt.org

SEE ALSO

Top

Jifty::DBI, Jifty::DBI::Handle, DBD::ODBC


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__