SQLayer - Interface to DB
use SQLayer; my $D = SQLayer -> new(database => 'DBI:mysql:database=phorum;host=localhost;port=3306', user => 'user', passowrd => 'somepass'); my $PAllRowsArrayRef = $D -> all_rows("SELECT a, b FROM dum"); # pointer to array my @AOneColumnArray = $D -> column("SELECT a FROM dum"); # array $D -> commit; # is equal to $D -> proc("COMMIT"); my $NConnectStatus = $D -> connect_status; # returns 1 if connected $D -> DEBUG(1); # warn query only $D -> DEBUG($n); # set trace level to $n-1 $D -> enable_transactions; # enable transactions if possible $D -> errstr; # returns error code my %HHashNameById = $D -> hash_all("SELECT id, name FROM dum"); # my $PHashOneByFieldsNameRef = $D -> hash_row("SELECT a, b, c FROM dum WHERE id = '1'"); # pointer to hash my %HHashOneByFieldsName = $D -> hash_var("SELECT a, b, c FROM dum WHERE id = '1'"); # hash $D -> nodebug; # No warn query and clear tracing $NAffectedRowsNum = $D -> proc("DELETE FROM dum WHERE a = b"); # affected rows my @AOneRowArray = $D -> row("SELECT a, b, c FROM dum WHERE id = '1'"); # array my $NVvalue = $D -> row("SELECT a FROM dum WHERE id = '1' "); # one value my $PRowOfHashRef = $D -> row_hash("SELECT a, b, c FROM dum"); # pointer to array of hashes $SQuoted = $D -> quote($SSomeVar); # same as DBI method
Need to written.
Written 1999 - 2003 (last change: 08.07.2003 11:16) by Andrew Gromozdin (ag@df.ru), Sergei Kadurin (ky@sema.ru), Andrei V. Shetuhin (stellar@akmosoft.comm. Please report all bugs to <stellar@akmosoft.com>.
Nothing known soon :)
perldoc DBI;
To install SQLayer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQLayer
CPAN shell
perl -MCPAN -e shell install SQLayer
For more information on module installation, please visit the detailed CPAN module installation guide.