DBD-Sprite
view release on metacpan or search on metacpan
lib/DBD/Sprite.pm view on Meta::CPAN
B<CursorName>
In addition to the DBI attributes, you can use the following dbh
attributes. These attributes are read-only after "connect".
I<sprite_dbdir>
Path to tables for database.
I<sprite_dbext>
File extension used on table files in the database.
I<sprite_dbuser>
Current database user.
I<sprite_dbfdelim>
Field delimiter string in use for the database.
I<sprite_dbrdelim>
Record delimiter string in use for the database.
The following are environment variables specifically recognized by Sprite.
I<SPRITE_HOME>
Environment variable specifying a path to search for Sprite
databases (*.sdb) files.
The following are Sprite-specific options which can be set when connecting.
I<sprite_CaseTableNames> => 0 | 1
By default, table names are case-insensitive (as they are in Oracle),
to make table names case-sensitive (as in MySql), so that one could
have two separate tables such as "test" and "TEST", set this option
to 1.
I<sprite_CaseFieldNames> => 0 | 1
By default, field names are case-insensitive (as they are in Oracle),
to make field names case-sensitive, so that one could
have two separate fields such as "test" and "TEST", set this option
to 1. The default is 1 (case-sensitive) if XML.
I<sprite_StrictCharComp> => 0 | 1
CHAR fields are always right-padded with spaces to fill out
the field. Old (pre 5.17) Sprite behaviour was to require the
padding be included in literals used for testing equality in
"where" clauses. I discovered that Oracle and some other databases
do not require this when testing DBIx-Recordset, so Sprite will
automatically right-pad literals when testing for equality.
To disable this and force the old behavior, set this option to 1.
I<sprite_Crypt> => [encrypt=|decrypt=][Crypt]::CBC;][[IDEA[_PP]|DES[_PP]|BLOWFISH[_PP];]keystring
Optional encryption and/or decryption of data stored in tables. By
omitting "encrypt=" and "decrypt=", data will be decrypted when read
from the table and encrypted when written to the table using the
"keystring" as the key.
I<sprite_forcereplace> => 0 | 1
This option forces the table file to first be deleted before being
overwritten. Default is 0 (do not delete, just overwrite it). This
was need by the author on certain network filesystems on one jobsite.
I<sprite_xsl> => xsl_stylesheet_url
Optional xsl stylesheet url to be included in database tables in XML
format. Otherwise, ignored. Default none.
I<silent> => 0 | 1
By default, on error, Sprite prints the legacy
"Oops! Sprite encountered the following error when processing your request..."
multiline error message carried over from the original Sprite by
Shishir Gurdavaram. Set to 1 to silense this, if it annoys you, or if you
are using Sprite in a CGI script.
The following attributes can be specified as a hash reference in "prepare"
statements:
I<sprite_reclimit> => #
Limit processing the table to # records. This is NOT the same as a
"LIMIT #" clause in selects. This limits the query to the first #
records in the table UNSORTED - BEFORE any constraints or sorting are
applied. This is useful for limiting queries to, say 1 record
simply to populate the column metadata.
I<sprite_actlimit> => #
This is the same as adding a "LIMIT #" clause to a select statement
when preparing it, as it will limit a query to returning # records
AFTER applying any constraints and sorting.
=head1 DRIVER PRIVATE METHODS
B<DBI>->B<data_sources>()
The `data_sources' method returns a list of "databases" (.sdb files)
found in the current directory and, if specified, the path in
the SPRITE_HOME environment variable.
$dbh->B<tables>()
This method returns a list of table names specified in the current
database.
Example:
my($dbh) = DBI->connect("DBI:Sprite:mydatabase",'me','mypswd');
my(@list) = $dbh->func('tables');
B<JSprite::fn_register>('myfn', __PACKAGE__);
( run in 1.593 second using v1.01-cache-2.11-cpan-e1769b4cff6 )