Acme::BeyondPerl::ToSQL::SQLite - SQLite support for Acme::BeyondPerl::ToSQL


Acme-BeyondPerl-ToSQL documentation Contained in the Acme-BeyondPerl-ToSQL distribution.

Index


Code Index:

NAME

Top

Acme::BeyondPerl::ToSQL::SQLite - SQLite support for Acme::BeyondPerl::ToSQL

SYNOPSIS

Top

 use Acme::BeyondPerl::ToSQL ("dbi:SQLite:dbname=acme_db","","");

 # or 

 use Acme::BeyondPerl::ToSQL ({
      dbi => ["dbi:SQLite:dbname=acme_db","",""], debug => 1,
 });

DESCRIPTION

Top

This module implements a SQLite version for Acme::BeyondPerl::ToSQL. You don't need to use this module directly.

SEE ALSO

Top

Acme::BeyondPerl::ToSQL,

SQLite

AUTHOR

Top

Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

COPYRIGHT AND LICENSE

Top


Acme-BeyondPerl-ToSQL documentation Contained in the Acme-BeyondPerl-ToSQL distribution.

package Acme::BeyondPerl::ToSQL::SQLite;

use strict;
use base qw(Acme::BeyondPerl::ToSQL);

our $VERSION = 0.01;

my $OPs = {
	'+'    => sub { shift->add(@_) },
	'-'    => sub { shift->sub(@_) },
	'*'    => sub { shift->mul(@_) },
	'/'    => sub { shift->div(@_) },
	'%'    => sub { shift->mod(@_) },
	'abs'  => sub { shift->abs(@_) },
	'<<'   => sub { shift->lshift(@_) },
	'>>'   => sub { shift->rshift(@_) },
	'&'    => sub { shift->and(@_) },
	'|'    => sub { shift->or(@_)  },
};

sub ops { return $OPs; }

##############################################################################
#
##############################################################################

package Acme::BeyondPerl::ToSQL::SQLite::__Integer;

use base qw(Acme::BeyondPerl::ToSQL::SQLite);

sub as_sql { sprintf("%.1f", ${$_[0]}); }

##############################################################################
#
##############################################################################

package Acme::BeyondPerl::ToSQL::SQLite::__Float;

use base qw(Acme::BeyondPerl::ToSQL::SQLite);
use strict;

sub as_sql { sprintf("%.16f", ${$_[0]}); }

##############################################################################
1;
__END__