Re: [Modeling-users] SQLite adaptor (more buglets)
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-08-02 08:36:16
|
Hi, > 1. Setting a .cfg, (that sets default adapter to SQLite, and uses the > interpolation feature of ConfigParser to set the data dir), pointing to > it via MDL_DB_CONNECTIONS_CFG, and running a number of > things gives an error, e.g: [...] > File "/usr/lib/python2.2/ConfigParser.py", line 293, in get > raise InterpolationError(key, option, section, rawval) > ConfigParser.InterpolationError: Bad value substitution: > section: [AuthorBooks] > option : database > key : db_data_dir > rawval : %(db_data_dir)s/db_AuthorBooks.db I do not know this interpolation feature, but it seems that you cfg file = is not syntacticly correct. > 2. Creation of an SQLite db via the utility does not work (previosly rep= orted > for pyms) also > for xml models. The command reports no error, but produces no output. (I= t is > of course > trivial to create a db in sqlite, by just doing 'sqlite file', but this = api > should be consistent with > the other adaptors. >=20 > % mdl_generate_DB_schema.py --admin-dsn localhost:StoreEmployees:dummy:d= ummy > -C StoreEmployees/MDL/model_StoreEmployees.xml > % I just noticed that error are swallowed by mdl_generate_DB_schema. Launching it with '-v' will give you the errors, if any (I've corrected it on cvs). > However, it should be noted that running the test scripts, e.g.: > % python ./test_EditingContext_Global.py -r -d SQLite > does create the SQLite db, except that it uses the SQLite.cfg in the tes= ts > dir. Yes, that's intended: tests uses their own settings (the .cfg file in tests/). > But, looking at the test scripts, the code used to create the db is very > different > than the code in the utility script. Could you be more specific? On my side, both test_EC_Global*.py 's reinitDB() and mdl_generate_DB_schema's databaseSchemaWithOptions() iterate on sql expressions returned by the adaptor's SchemaGeneration.schemaCreationStatementsForEntities(). > 3. After creating the db manually, to be able to proceed, generating the > schema does not work, as shown below. In the XML case, no error is > reported, but the db is not been modified at all: >=20 > % mdl_generate_DB_schema.py -R --admin-dsn > localhost:StoreEmployees:dummy:dummy pymodel_StoreEmployees.py > Drop Database FAILED > Reason: >=20 > exceptions.NameError > global name 'cnx' is not defined [...] > File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ > SQLiteAdaptorLayer/SQLiteAdaptor.py", line 85, in > dbAPI_gimmeCnxAndCursorForDBAdmin > cnx.autocommit() [...] I have registered it under bug #781884 https://sf.net/tracker/index.php?func=3Ddetail&aid=3D781884&group_id=3D5893= 5&atid=3D489335 and fixed it. You'll find a patch attached to the bug report, and the fix is also in cvs. Thanks for all you comments and reports, -- S=E9bastien. |