The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SQLayer - Interface to DB

SYNOPSIS

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

METHODS

Need to written.

AUTHOR

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>.

BUGS

Nothing known soon :)

SEE ALSO

perldoc DBI;