Author: phd
Date: 2007-04-24 09:00:34 -0600 (Tue, 24 Apr 2007)
New Revision: 2586
Modified:
SQLObject/branches/0.8/docs/FAQ.txt
Log:
Added an answer and examples to the FAQ on how to use sqlmeta.createSQL.
Modified: SQLObject/branches/0.8/docs/FAQ.txt
===================================================================
--- SQLObject/branches/0.8/docs/FAQ.txt 2007-04-24 11:31:59 UTC (rev 2585)
+++ SQLObject/branches/0.8/docs/FAQ.txt 2007-04-24 15:00:34 UTC (rev 2586)
@@ -506,3 +506,25 @@
cannot return a list of meaningful objects.
You can use a lower-level machinery available in SQLBuilder_.
+
+How can I specify the MySQL engine to use, or tweak other SQL-engine specific features?
+---------------------------------------------------------------------------------------
+
+You can *ALTER* the table just before creation using the ``sqlmeta``
+attribute ``createSQL``, for example::
+
+ class SomeObject(SQLObject):
+ class sqlmeta:
+ createSQL = { 'mysql' : 'ALTER TABLE some_object ENGINE InnoDB' }
+ # your columns here
+
+Maybe you want to specify the charset too? No problem::
+
+ class SomeObject(SQLObject):
+ class sqlmeta:
+ createSQL = { 'mysql' : '''
+ ALTER TABLE some_object ENGINE InnoDB;
+ ALTER TABLE some_object CHARACTER SET utf8
+ COLLATE utf8_estonian_ci''' }
+ # your columns here
+
|