NAME
Util::SQLiteDB::UniSchema - Interface to a single-schema SQLite DB
VERSION
This documentation describes version 0.01
SCHEMA
key TEXT NOT NULL,
value TEXT,
PRIMARY KEY ( key )
SYNOPSIS
use Util::SQLiteDB::UniSchema;
my $file = '/db/file/path';
my @table = qw( table1 table2 .. );
my $db = Util::SQLiteDB::UniSchema->new( $file, table => \@table );
my $db_existing = Util::SQLiteDB::UniSchema->new( $file );
$db->set( 'table1', 'key1', 'value1' );
my %keyval = $db->dump( 'table2' );
map { $db->delete( $_, key => 'key1', val => 'value2' ) } $db->table();
$db->truncate( 'table2' );
my $quoted = $db->quote( "bob loblaw's law blog" )
set( table, @key, @value )
INSERT or UPDATE keys and values into table. Returns status of operation.
dump( table )
Dump all records from a table into a HASH. Returns HASH reference in scalar context. Returns flattened HASH in list context.
delete( table, delete_key => key, delete_val => value )
Deletes by key, or by value, or by key or value from a table.
truncate( table )
Deletes all records from a table.
quote( string )
See DBI::quote().
table()
Returns a list of all tables. Returns ARRAY reference in scalar context.
stat()
Stat of database file. Also see stat(). Returns ARRAY reference in scalar context.
SEE ALSO
DBI
AUTHOR
Kan Liu
COPYRIGHT and LICENSE
Copyright (c) 2010. Kan Liu
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.