[docs] docs - heins modified icdatabase.sdf

docs at icdevgroup.org docs at icdevgroup.org
Sun Apr 11 14:50:26 EDT 2004


User:      heins
Date:      2004-04-11 18:50:26 GMT
Modified:  .        icdatabase.sdf
Log:
* Document some previously-undocumented SQL database parameters.

Revision  Changes    Path
1.63      +105 -3    docs/icdatabase.sdf


rev 1.63, prev_rev 1.62
Index: icdatabase.sdf
===================================================================
RCS file: /anon_cvs/repository/docs/icdatabase.sdf,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- icdatabase.sdf	11 Apr 2004 18:38:41 -0000	1.62
+++ icdatabase.sdf	11 Apr 2004 18:50:26 -0000	1.63
@@ -1,10 +1,10 @@
 !init OPT_LOOK="icdevgroup"; OPT_STYLE="manual"
-# $Id: icdatabase.sdf,v 1.62 2004/04/11 18:38:41 kwalsh Exp $
+# $Id: icdatabase.sdf,v 1.63 2004/04/11 18:50:26 mheins Exp $
 
 !define DOC_NAME "Interchange Databases"
 !define DOC_TYPE ""
 !define DOC_CODE "icdatabase"
-!define DOC_VERSION substr('$Revision: 1.62 $',11, -2)
+!define DOC_VERSION substr('$Revision: 1.63 $',11, -2)
 !define DOC_STATUS "Draft"
 !define DOC_PROJECT "Interchange"
 !define DOC_URL "http://www.icdevgroup.org/doc/icdatabase.html"
@@ -540,7 +540,43 @@
 >	Database country_memory MIRROR          country
 >	Database country_memory MEMORY          1
 
-H2: COMPOSITE_KEY
+H2: SQL/DBI parameters
+
+=over 4
+
+=item AUTO_SEQUENCE
+
+Tells Interchange to use a SQL sequence to number new database items
+inserted into the database. 
+
+If you have Interchange create the table, then you need to do:
+
+	Database foo foo.txt dbi:mysql:test
+	Database foo AUTO_SEQUENCE foo_seq
+
+Then on MySQL, Pg, or Oracle, Interchange will create an integer
+key type and a sequence (or AUTO_INCREMENT in MySQL) to maintain
+the count.
+
+=item AUTO_SEQUENCE_MAXVAL
+
+Sets the MAXVAL to have in an AUTO_SEQUENCE counter:
+
+	Database foo AUTO_SEQUENCE_MAXVAL  1000000
+
+=item AUTO_SEQUENCE_MINVAL
+
+Sets the MINVAL to have in an AUTO_SEQUENCE counter:
+
+	Database foo AUTO_SEQUENCE_MINVAL  10
+
+=item AUTO_SEQUENCE_START
+
+Sets the starting value for an AUTO_SEQUENCE counter:
+
+	Database foo AUTO_SEQUENCE_START  1000
+
+=item COMPOSITE_KEY
 
 If you are using a DBI table with composite keys, where two or more
 fields combine to make the unique identifier for a record, you must
@@ -556,6 +592,72 @@
 don't specify a POSTCREATE or INDEX parameter for the table, Interchange
 will create a unique index with all composite key elements at table
 creation time.
+
+=item DSN
+
+The data source name (DSN) for the database. It is beyond the
+scope of this document to describe this in detail.
+
+Normally this is set as the type in the initial C<Database> 
+configuration line, i.e.
+
+  Database  foo  foo.txt  dbi:mysql:foobase
+
+This has the same effect:
+
+  Database  foo  foo.txt  SQL
+  Database  foo  DSN      dbi:mysql:foobase
+
+Some other examples of DSN specs:
+
+  Database  foo  DSN  dbi:mysql:host=db.you.com;database=foobase
+  Database  foo  DSN  dbi:Pg:dbname=foobase
+  Database  foo  DSN  dbi:Oracle:host=myhost.com;sid=ORCL
+	
+=item HAS_TRANSACTIONS
+
+Informs Interchange that the SQL database in use has commit() and
+rollback() for transactions. For PostgreSQL and Oracle this should be
+set properly to 1 -- for MySQL and other databases you have to set it.
+
+=item HAS_LIMIT
+
+Informs Interchange that the SQL database in use has as the LIMIT
+extension to SQL to limit return from queries. Should be set properly
+by default for MySQL, PostgreSQL, and Oracle.
+
+=item POSTCREATE
+
+One or more SQL statements that should be performed after
+Interchange creates a table.
+
+ Database foo POSTCREATE "create unique index foo_idx on foo(key1,key2)"
+ Database foo POSTCREATE "create index mulkey_idx on foo(mulkey)"
+
+=item PRECREATE
+
+One or more SQL statements that should be performed before
+Interchange creates a table.
+
+ Database foo POSTCREATE "drop table foobackup"
+ Database foo POSTCREATE "alter table foo rename to foobackup"
+
+=item REAL_NAME
+
+Sometimes it may be convenient to have a table named a consistent
+value in Interchange despite its name in the underlying database.
+For instance, two divisions of a company may share orders but
+have different C<products> tables.  You can tell Interchange to
+name the table C<products> for its purposes, but use the C<products_a>
+table for SQL statements:
+
+	Database products REAL_NAME products_a
+
+Of course if you have SQL queries that are passed verbatim to 
+Interchange (i.e. the [query ...] tag) you must use the REAL_NAME
+in those.
+
+=back
 
 H2: Importing in a Page
 








More information about the docs mailing list