Acme::BeyondPerl::ToSQL - RDBMS calculates instead of Perl
use Acme::BeyondPerl::ToSQL ("dbi:SQLite:dbname=acme_db","",""); my $value = 5; print 2 + $value , "\n"; # 7 print 1.2 - 0.2 , "\n"; # 1 print 9 / 2 , "\n"; # 4.5 # DEBUG MODE # use Acme::BeyondPerl::ToSQL ({ # dbi => ["dbi:SQLite:dbname=acme_db","",""], debug => 1, # }); # # SELECT 1.2000000000000000 - 0.2000000000000000 # SELECT 9.0 / 2.0 # SELECT 2.0 + 5.0 # use Acme::BeyondPerl::ToSQL ({ # dbi => ["dbi:Pg:dbname=$dbname;host=$host", $user, $pass], debug => 1, # }); # # SELECT CAST(1.2 AS double precision) - CAST(0.2 AS double precision) # SELECT CAST(9 AS double precision) / CAST(2 AS double precision) # SELECT CAST(2 AS double precision) + CAST(5 AS double precision)
When you use Acme::BeyondPerl::ToSQL, your RDBMS will calculate instead of Perl!
Acme::BeyondPerl::ToSQL
Currently supported RDBMS are SQLite, PostgreSQL and MySQL.
To use DBI, you must pass some arguments.
use Acme::BeyondPerl::ToSQL ("dbi:SQLite:dbname=acme_db","",""); use Acme::BeyondPerl::ToSQL ("dbi:Pg:dbname=$dbname;host=$host", $user, $pass, \%opts);
use Acme::BeyondPerl::ToSQL ({ dbi => ["dbi:SQLite:dbname=acme_db","",""], debug => 1, });
None.
All the effects of this module are constrained to overload and overload::constant.
overload
overload::constant
There might be an operator not supported.
When this module is used at the same time with two or more files on Windows 2000 + ActivePerl, I find a warning "Attempt to free unreferenced scalar".
overload,
overload::constant,
DBI
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
Copyright 2005 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Acme::BeyondPerl::ToSQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::BeyondPerl::ToSQL
CPAN shell
perl -MCPAN -e shell install Acme::BeyondPerl::ToSQL
For more information on module installation, please visit the detailed CPAN module installation guide.