Fey::FakeDBI - Just enough of the DBI API to fool Fey


Fey documentation Contained in the Fey distribution.

Index


Code Index:

NAME

Top

Fey::FakeDBI - Just enough of the DBI API to fool Fey

VERSION

Top

version 0.40

SYNOPSIS

Top

  my $select = Fey::SQL->new_select();

  $select->select(...)->where(...);

  print $select->sql( 'Fey::FakeDBI' );

DESCRIPTION

Top

This class provides just enough of the DBI API to use when Fey needs a DBI object for quoting SQL statements. It implements the quote() and quote_identifier() methods only.

It exists solely to allow some internal API re-use for Fey, and you should never need to use it explicitly.

BUGS

Top

See Fey for details on how to report bugs.

AUTHOR

Top

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

Top


Fey documentation Contained in the Fey distribution.

package Fey::FakeDBI;
BEGIN {
  $Fey::FakeDBI::VERSION = '0.40';
}

use strict;
use warnings;

# This package allows us to use a DBI handle in id(). Even though we
# may not be quoting properly for a given DBMS, we will still generate
# unique ids, and that's all that matters.

sub quote_identifier {
    shift;

    if ( @_ == 3 ) {
        return q{"} . $_[1] . q{"} . q{.} . q{"} . $_[2] . q{"};
    }
    else {

        return q{"} . $_[0] . q{"};
    }
}

sub quote {
    my $text = $_[1];

    $text =~ s/"/""/g;
    return q{"} . $text . q{"};
}

1;

# ABSTRACT: Just enough of the DBI API to fool Fey




__END__