DBD-Sprite

 view release on metacpan or  search on metacpan

DBDSprite.htm  view on Meta::CPAN

</PRE>
<P>
<PRE>    In addition to the DBI attributes, you can use the following dbh
    attributes.  These attributes are read-only after &quot;connect&quot;.
</PRE>
<P>
<PRE>
    The following are Sprite-specific options which can be set when connecting.

    sprite_dbdir
            Path to tables for database.
                
    sprite_dbext
        File extension used on table files in the database.
                
    sprite_dbuser
        Current database user.

    sprite_field
        Field delimiter string in use for the database.
        Default specified in database configuration file (<dbname>.sdb)
                
    sprite_read
        Field delimiter string in use for inputting the database.
        Default = sprite_field
                
    sprite_write
        Field delimiter string in use for outputting the database.
        Default = sprite_field
                
    sprite_xsl  (NEW)
        Allows specifying of a url to an xsl template to be written to xml 
        documents (when using the "xml" option).  This makes it very easy to 
        view your tables via M$ Internet Explorer browser!

        Example:  sprite_xsl => 'http://turnerville.wwol.com/jim/spritexml2html.xsl'
        
        Default is none.  Only applies if "sprite_field" is set to "xml"!

    sprite_dbfdelim - DEPRECIATED, now use "sprite_field"!
        Field delimiter string in use for the database.
                
    sprite_dbrdelim - DEPRECIATED, now use "sprite_record"!
        Record delimiter string in use for the database.
                
    sprite_CaseTableNames
        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.

    sprite_CaseFieldNames  (NEW)
        By default, field names are case-insensitive (as they are in Oracle),
        to make field names case-sensitive (as in XML), so that one could
        have two separate fields such as "field1" and "Field1", set this option
        to 1.

    sprite_Crypt
        "0" by defalt.  Specifies that encryption is to be used when storing 
        the data in the flat-file.  To use, download "Crypt::CBC", and one 
        or more of "Crypt::DES", "Crypt::IDEA", or "Crypt::Blowfish".  You 
        can specify using any of the following formats:
        
            sprite_Crypt => 'my key string'
                Use Blowfish encryption.
            sprite_Crypt => 'DES;my key string'
                Use DES encryption.
            sprite_Crypt => 'encrypt=CBC;IDEA;my key string'
                Use IDEA encription, but read in table as unencrypted, then 
                write it out encrypted (great for encrypting previously 
                unencrypted tables).
            sprite_Crypt => 'decrypt=CBC;Blowfish;my key string'
                use Blowfish encryption, but write out table unencrypted. 
                This allows one to fetch an encrypted table and write it back 
                out unencrypted.

    sprite_reclimit  (aka. sprite_sizelimit)
        Allows user to specify the maximum number of records to be returned 
        by a single query.  Default is "0", which permits an unlimited number.

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

    sprite_lock_file
        Specify alternate path/file to use for file-locking on os'es without 
        a working "flock" (ie. M$ os'es).  Default is 
        "/path/to/where/my/tables/are/Sprite.lck".  This is useful if the 
        file-system your tables are on is read-only.

    sprite_lock_try
        Allows user-specification of the number of times to try to create 
        lock-file on os'es without a working "flock" (ie. M$ os'es).  Default 
        is 10.

    sprite_forcereplace
        Forces existing Sprite table file to be deleted and recreated in lieu 
        of being overwritten.  This was necessary because the author uses a 
        Samba filesystem which for some reason does not permit overwriting 
        of files.

    SPRITE_HOME
        Environment variable specifying a path to search for Sprite 
        databases (*.sdb) files.
</PRE>
<P>
<H1><A NAME="DRIVER PRIVATE METHODS">DRIVER PRIVATE METHODS</A></H1>
<P>
<PRE>    DBI-&gt;data_sources()
        The `data_sources' method returns a list of &quot;databases&quot; (.sdb files) 
        found in the current directory and, if specified, the path in 
        the SPRITE_HOME environment variable.
        
    $dbh-&gt;tables()
        This method returns a list of table names specified in the current 
        database.

DBDSprite.htm  view on Meta::CPAN

		  Caught by Simon Elliott, Thanks!  Also fixed several other minor glitches.
		<BR>- Fixed bug forbidding sequence files in mixed-case directories unless 
		  CaseTableNames was set (CaseTableNames only applies to the file-name).
		  Also added code to display &quot;$@&quot; and &quot;$?&quot; in the error details message on 
		  -511 errors (could not [over]write file).
	<LI>0.21	 Wed Sep 12, 2001
		<BR>- Fixed AutoCommit to actually work.  Caught by Jojo Kamote Escubil, Thanks,
		  Jojo!  Also fixed another bug affecting quoted value strings containing 
		  question marks (Caught by me!)
	<LI>0.22  Mon Sep 17, 2001
		<BR>- Removed regex optimization (s///o) which caused record and field separators 
		  to not work right when one opened a database, closed that database, then 
		  opened a second database with different record and or field separators.
		  Caught by Larry Yudelson, Thanks!
	<LI>0.23  Thu Oct 23, 2001
		<BR>- Added new regex feature to allow one to capture regex matches and update 
		  field values, ie:  
		       update MYTABLE set FIELD1 = '$1' where FIELD2 =~ '(\d+)'
		  This will set FIELD1 to the 1st number found in FIELD2 in the same 
		  record.  Up to 2 matches for each &quot;where&quot; expression containing &quot;=~&quot; or 
		  &quot;!~&quot; may be captured.  $1 .. $n correspond to each set of unescaped 
		  parenthesis from left to right in the &quot;where&quot; clause.
		<BR>- Added TO_CHAR function for converting Perl &quot;time&quot; values to printable 
		  formats.  Has most date and numeric functions in the two-argument 
		  form of the Oracle &quot;TO_CHAR&quot; function, which it is designed to emulate.
		<BR>- Added some optimization for mass-updates.
		<BR>- Added many other new Oracle functions (TO_NUMBER, USER, ABS, COS, EXP, 
          FLOOR, MOD, POWER, ROUND, SIGN, SIN, TRUNC, CHR, INITCAP, LTRIM, 
          REPLACE, RTRIM, TRANSLATE, ASCII, LENGTH, SYSDATE.  All should now 
          work when selected from &quot;DUAL&quot;.
        <BR>- Selecting from &quot;DUAL&quot; should now work as expected.
	<LI>0.26  Mon Oct 29, 2001
		<BR>- Fixed bug introduced in 0.24 where tests failed not finding &quot;makesdb.pl&quot;.
		<BR>- Fixed test failure on Windows platforms (I think).
	    <BR>- Added still more Oraclish functions (CEIL, EXP, INSTR, INSTRB, LAST_DAY, 
	      LPAD, NVL, RPAD, LAST_DAY, and SQRT.  Fixed FLOOR.
	      It should be noted that these functions do almost no error-checking.
	    <BR>- Added date-handling capability to TRUNC.
	    <BR>- Added &quot;AUTONUMBER&quot; datatype to allow autonumbering without sequences.  
	      This emulates the way M$-Access(ODBC) does things.
	<LI>0.27	 Fri Nov 15, 2001
		<LI>Eliminated &quot;reserved&quot; status of special characters \x02 .. \x06 and \n 
		  by now using single &quot;reserved&quot; string pattern:  &quot;\x02\^#jSpR1tE\x02&quot;, 
		  where &quot;#&quot; can be any digit 0..9.  The purpose of this is to allow for 
		  temporarily protecting some strings while performing string searches 
		  and substitutions, ie. protecting commas within quoted literal values 
		  while splitting the encompassing string on commas as separators.  \n 
		  has previously been &quot;flattened&quot; out into spaces in order to treat 
		  multiline queries as a single line.  This is still done, but numerous 
		  regices were modified with the &quot;s&quot; option.  Please report anything that 
		  might be broken by this new release!
	<LI>0.30  Thu Jan 10
		<BR>- Fixed bug where specifying a negative number in a &quot;where&quot; clause 
		  as an unbound constant, returned all records and set the field in all 
		  records to that number (ouch!)
		<BR>- Fixed bug there double-backslashes in data inserted into a table were 
		  converted to a single backslash.
		<BR>- Added better &quot;BLOB&quot; support.  BLOB/LONG/MEMO fields no longer have 
		  default length specified as 5000 and data should no longer be truncated.
		<BR>- ADDED ENCRYPTION OPTION!  If the &quot;Crypt::CBC&quot;, and &quot;Crypt::IDEA&quot;, &quot;Crypt::Blowfish&quot; or 
		  &quot;Crypt::DES&quot; are available, you can connect specifying 
		  &quot;sprite_Crypt => 'IDEA;any_key_string'&quot; (use &quot;DES&quot; in lieu of &quot;IDEA&quot;, 
		  if so inclined).  To read in existing unencrypted tables and write them 
		  out encrypted, use &quot;sprite_Crypt => 'encrypt=IDEA;your_key_string'&quot;.
		  To read in encrypted databases and write them back unencrypted, use: 
		  &quot;sprite_Crypt => 'decrypt=IDEA;your_key_string'&quot;.  Note:  Any method 
		  of encryption that Crypt::CBC supports may be used instead of IDEA or 
		  DES, if you have the module installed.
	<LI>0.31  Thu Feb 22
		<BR>- Fixed bug which prevented one from using single-letter field names.
		  (caught by me).
		<BR>- Fixed bug which caused SELECTs to sometimes fail with psuedo-columns and 
		  functions, ie. sequence.NEXTVAL (caught by me).
		<BR>- Fixed bug that caused extra &quot;-528:Could not read/write BLOB file&quot; errors 
		  to be displayed after other errors (caught by me).
		<BR>- Added code so &quot;darwin&quot; (new Mac-OS) would use unix &quot;/&quot; separator, was 
		  using WinDOwS separators (&quot;\\&quot;) for directories (caught by Thabo).
		<BR>- Changed internal &quot;lock_file&quot; and &quot;lock_try&quot; to &quot;sprite_lock_file&quot; and 
		  &quot;sprite_lock_try&quot; respectively to allow user to override defaults.  This 
		  was requested to permit Sprite databases to exist on read-only filesystems.
		  This is only applicable to os'es originating from a huge corporation 
		  based in Redmond, VA. that don't support flock.  See the README file for 
		  more notes about file locking!
		<BR>- Added code to check &quot;Create&quot; command to make sure tables/sequences 
		  actually get created or else report error (caught by Dave Thorn).
		<BR>- Added RAW datatype (psuedonym for VARCHAR), since in Perl, any 
		  valid ASCII character can be inserted into a string.  NOTE:  Oracle 
		  requires packing and unpacking to hex!
	<LI>0.33  Fri May 10
		<BR>- Added code so "bsdos" (BSD/OS) would use unix "/" separator, was 
	  	  being treated as "dos" and using WinDOwS separators ("\\") for 
	  	  directories (caught by Sweth Chandramouli), Thanks!
		<BR>- Added ability to specify path and or extension to database names in the 
	  	  connect function (The default of ".sdb" and path ($ENV{SPRITE_HOME}/, 
	  	  "./", then $ENV{HOME}/ still apply).  If database name contains a dot 
	  	  ("."), then the ".sdb" extension is not added.  If the database name 
	  	  begins with a "/", then it is assumed to be an absolute path, otherwise, 
	  	  the dafault search-paths (described above) are applied.
	<LI>0.34  Wed May 22
		<BR>- Added beta (incomplete) XML support!  By specifying 'XML' as your record 
		  seperator, your tables will be stored in XML format instead of Sprite's 
		  usual delimited text format.  Special XML characters (<, >, &, and --) 
		  are escaped to proper XML format, ie. &lt;, etc.  Use of this option requires 
		  the installation of the Perl module "XML::Simple".  The reason this is 
		  beta is because I'm a newbe to XML and have not yet been able to get 
		  all binary data to work correctly, namely high-ascii characters.  If 
		  you see what I am missing, please feel free to tell me and or send 
		  patches!
		<BR>- Fixed bug where single-quotes appearing in fields in UPDATE statements 
		  caused -517 errors.
		<BR>- Added ability to separately specify the field separator string for input 
		  vs output.  Original Sprite supported this, but I always set them to be 
		  the same.  By default they still are.  This became useful to me when 
		  testing XML because I could specify the output field separator as 'XML' 
		  and the input one as whatever my existing table was, read it in and 
		  write it right back out as XML!  The new options are:  sprite_read, 
		  sprite_write, and sprite_field.  The latter sets both to the same thing.
		  sprite_record sets the record separator.
	<LI>0.35  Thu May 30
		<BR>- Made global variable "CBC" an object variable fixing bug which caused 
	  	  problems when one used both an encrypted database and an unencrypted one 



( run in 1.416 second using v1.01-cache-2.11-cpan-39bf76dae61 )