DBIx::Simple::Examples 1.30 |
Date Added: November 11, 2010 | Visits: 401 |
|
||||||||
|
[COPRIGHT=1] EXAMPLES General #!/usr/bin/perl -w use strict; use DBIx::Simple; # Instant database with DBD::SQLite my $db = DBIx::Simple->connect(dbi:SQLite:dbname=file.dat) or die DBIx::Simple->error; # Connecting to a MySQL database my $db = DBIx::Simple->connect( DBI:mysql:database=test, # DBI source specification test, test, # Username and password { RaiseError => 1 } # Additional options ); # Using an existing database handle my $db = DBIx::Simple->connect($dbh); # Abstracted example: $db->query($query, @variables)->what_you_want; $db->commit or die $db->error; Simple Queries $db->query(DELETE FROM foo WHERE id = ?, $id) or die $db->error; for (1..100) { $db->query( INSERT INTO randomvalues VALUES (?, ?), int rand(10), int rand(10) ) or die $db->error; } $db->query( INSERT INTO sometable VALUES (??), $first, $second, $third, $fourth, $fifth, $sixth ); # (??) is expanded to (?, ?, ?, ?, ?, ?) automatically Single row queries my ($two) = $db->query(SELECT 1 + 1)->list; my ($three, $four) = $db->query(SELECT 3, 2 + 2)->list; my ($name, $email) = $db->query( SELECT name, email FROM people WHERE email = ? LIMIT 1, $mail )->list; Or, more efficiently: $db->query(SELECT 1 + 1)->into(my $two); $db->query(SELECT 3, 2 + 2)->into(my ($three, $four)); $db->query( SELECT name, email FROM people WHERE email = ? LIMIT 1, $mail )->into(my ($name, $email));.
|
| License: Freeware | Size: 15.36 KB |
|
Libraries
-
Email::Store::DBI 0.254
Email::Store::DBI is a Perl module for database backend to Email::Store. SYNOPSIS use Email::Store dbi:...; This class is a subclass of Class::DBI and contains means for Email::Store-based programs to register what DSN they wish to use. It... |
28.67 KB | |
|
Libraries
-
DBIx::CGITables 0.001
DBIx::CGITables is a Perl module for easy DB access from a CGI. SYNOPSIS use DBIx::CGITables; my %parameters=(); my $query=DBIx::CGITables->new(%parameters)); $query->search_execute_and_do_everything_even_parse_the_template(); This module... |
20.48 KB | |
|
Libraries
-
DBIx::Recordset 0.26
DBIx::Recordset is a Perl extension for DBI recordsets. SYNOPSIS use DBIx::Recordset; # Setup a new object and select some recods... *set = DBIx::Recordset -> Search ({!DataSource => dbi:Oracle:...., !Table => users, $where => name = ?... |
94.21 KB | |
|
Libraries
-
Search::Tools::Keywords 0.06
Search::Tools::Keywords is a Perl module to extract keywords from a search query. SYNOPSIS use Search::Tools::Keywords; use Search::Tools::RegExp; my $query = the quick fox color:brown and "lazy dog" not jumped; my $kw =... |
49.15 KB | |
|
Libraries
-
DBIx::SQLCrosstab 1.17
DBIx::SQLCrosstab Perl module creates a server-side cross tabulation from a database. SYNOPSIS use DBIx::SQLCrosstab; my $dbh=DBI->connect("dbi:driver:database" "user","password", {RaiseError=>1}) or die "error in connection $DBI::errstrn";... |
72.7 KB | |
|
Libraries
-
DBIx::Version 0.01
DBIx::Version is a Perl extension for getting database software name and version. SYNOPSIS use DBIx::Version; my $dbh = DBI->connect( ... ); my ($dbname, $dbver, $dbverfull) = DBIx::Version::Version($dbh); DBIx::Version lets you query... |
3.07 KB | |
|
Libraries
-
DBIx::HTMLinterface 0.11
DBIx::HTMLinterface is a class for creating a CGI interface to a database. SYNOPSIS use CGI; use DBI; use DBIx::HTMLinterface; $cgi = new CGI; $dbh = DBI->connect("DBI:mysql:[DATABASE]:[HOSTNAME]","[USERNAME]","[PASSWORD]") );... |
16.38 KB | |
|
Libraries
-
DBIx::Wrapper 0.24
DBIx::Wrapper library is a Perl module that serves as a wrapper around DBI, providing additional functionality and convenience methods. Whats New in This Release: - This release adds convenience methods for generating CSV, XML, and bencoded... |
27.65 KB | |
|
Libraries
-
Template::Plugin::JavaSQL 0.4
Template::Plugin::JavaSQL is a Perl module to help generate Java from database schemas. SYNOPSES Within an XML file processed by the Java plugin: or < sql: table="some_table"... |
18.43 KB | |
|
Libraries
-
DBIx::Timeout 1.01
DBIx::Timeout is a Perl module that provides a safe method of timing out DBI requests. The method described in the DBI documentation uses unsafe signals, which may cause memory corruption. DBIx::Timeout instead uses a separate timeout process.... |
6.14 KB |
|
Programming
-
RailsTidy 0.1
RailsTidy project is a plugin for Ruby On Rails.. |
11.26 KB | |
|
Programming
-
Strings edit 1.9
Strings edit is a library that provides I/O facilities for integer, floating-point, Roman numbers, and strings. Both input and output subroutines support string pointers for consequent stream processing. The output can be aligned in a fixed size... |
54.27 KB | |
|
Programming
-
BScript 0.3
BScript is a (yet another) BASIC interpreter. It is free software and open-sourced, licensed under the terms of the GNU General Public License version 2 or later. You can use BScript to teach BASIC to your students, write understandable shell... |
112.64 KB | |
|
Programming
-
Kits JavaScript Brainf*ck Interpreter 0.01
Kits JavaScript Brainf*ck Interpreter is a rather fast interpreter for the Brainf*ck esoteric programming language.. Kit's JavaScript Brainfuck Interpreter v0.01 |
5.12 KB | |
|
Programming
-
dis6502 0.12
dis6502 is a flow-tracing disassembler for the 6502, originally written by Robert Bond and supporting Atari binary files. Robert posted dis6502 to the Usenet newsgroup net.sources on 9-Oct-1986, and to comp.sources.unix 7-Jun-1988. Udi... |
19.46 KB | |
|
Libraries
-
Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;... |
8.19 KB | |
|
Libraries
-
sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also... |
10.24 KB | |
|
Libraries
-
App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>... |
54.27 KB | |
|
Libraries
-
PDL::Graphics::TriD 2.4.3
PDL::Graphics::TriD is a PDL 3D interface. SYNOPSIS use PDL::Graphics::TriD; # After each graph, let the user rotate is and # wait for him to press q, then make new graph line3d($coords); # $coords = (3,n,...) line3d($coords,$colors); #... |
2.1 MB | |
|
Libraries
-
SmartColorWell 1.2
SmartColorWell is a cross-platform open-source ColorWell class for REALbasic 4 or greater. The SmartColorWell control stores a color value and displays that color in a simulated BevelButton that when pressed allows the user to change the color... |
21.5 KB |
