DBD-SQLcipher
view release on metacpan or search on metacpan
NAME
DBD::SQLcipher - Self-contained RDBMS in a DBI Driver
SYNOPSIS
use DBI;
my $dbh = DBI->connect("dbi:SQLcipher:dbname=$dbfile","","");
DESCRIPTION
This module is heavily based on the DBD::SQLite CPAN module - the main
difference it that this module comes bundled together with SQLcipher
from Zetetic - an open source extension to SQLite that provides transparent
256-bit AES encryption of database files. Furthermore, this module is fully
compatible with SQLite databases.
Therefore, in the following document, which is a copy of the DBD::SQLite
documentation, the term sqlite shall be used to mean sqlcipher.
Furthermore, in the specific places where the module implements extended
functionality only relevant to SQLcipher, this shall be marked explicitly.
Note that SQLcipher depends on the OpenSSL library, which should be installed
in your system.
SQLcipher supports the following features:
Implements a large subset of SQL92
See <http://www.sqlite.org/lang.html> for details.
A complete DB in a single disk file
Everything for your database is stored in a single disk file, making
it easier to move things around than with DBD::CSV.
Atomic commit and rollback
Yes, DBD::SQLcipher is small and light, but it supports full
transactions!
Extensible
User-defined aggregate or regular functions can be registered with
the SQL parser.
There's lots more to it, so please refer to the docs on the SQLcipher web
page, listed above, for SQL details. Also refer to DBI for details on
how to use DBI itself. The API works like every DBI module does.
However, currently many statement attributes are not implemented or are
limited by the typeless nature of the SQLcipher database.
NOTABLE DIFFERENCES FROM OTHER DRIVERS
Database Name Is A File Name
SQLcipher creates a file per a database. You should pass the "path" of the
database file (with or without a parent directory) in the DBI connection
string (as a database "name"):
my $dbh = DBI->connect("dbi:SQLcipher:dbname=$dbfile","","");
The file is opened in read/write mode, and will be created if it does
not exist yet.
Although the database is stored in a single file, the directory
containing the database file must be writable by SQLcipher because the
library will create several temporary files there.
If the filename $dbfile is ":memory:", then a private, temporary
in-memory database is created for the connection. This in-memory
database will vanish when the database connection is closed. It is handy
for your library tests.
Note that future versions of SQLcipher might make use of additional special
filenames that begin with the ":" character. It is recommended that when
a database filename actually does begin with a ":" character you should
prefix the filename with a pathname such as "./" to avoid ambiguity.
( run in 0.905 second using v1.01-cache-2.11-cpan-e1769b4cff6 )