Re: [Modeling-users] SQLite adaptor (buglets)
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-08-01 19:02:53
|
Hi Mario, > 1. Changing to adaptorName=3D'SQLite' in the pymodel_StoreEmployees.py, = gives: >=20 > % mdl_validate_model.py -v pymodel_StoreEmployees.py > Loading the model... > Done. > Validating... > Done. > Object: Model StoreEmployees > ---------------------------- > * Warning(s): > - adaptorName 'SQLite' is not one of the framework's, maybe one of y= ours > % >=20 This is really strange. Look at ModelValidation.validateModel_internals(): you can get this when the adaptor's name is not in the declared list of valid adaptor. this means that, somehow, mdl_validate_model.py uses an old version of ModelValidation, v1.6 or lower (SQLite was added in v1.7). Can you check your python path? > 2. When running with SQLite, an admin-connection-dict should not be requ= ired? >=20 > % mdl_generate_DB_schema.py -C pymodel_StoreEmployees.py > Error: option -C requires --admin-connection-dict > % >=20 >=20 > 3. Supplying an admin-dsn: >=20 > % mdl_generate_DB_schema.py --admin-dsn localhost:StoreEmployees:dummy:d= ummy > -C pymodel_StoreEmployees.py > Create Database FAILED > Reason: > exceptions.NameError > global name 'cnx' is not defined > File "/usr/bin/mdl_generate_DB_schema.py", line 85, in > databaseSchemaWithOptions > adaptor.createDatabaseWithAdministrativeConnectionDictionary(admini= strat > iveConnectionDictionary, createUser) > File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ > AbstractDBAPI2AdaptorLayer/AbstractDBAPI2Adaptor.py", line 129, in > createDatabaseWithAdministrativeConnectionDictionary > cnx, > cur=3Dself.dbAPI_gimmeCnxAndCursorForDBAdmin(administrativeConnectionDict= i onary) > File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ > SQLiteAdaptorLayer/SQLiteAdaptor.py", line 85, in > dbAPI_gimmeCnxAndCursorForDBAdmin > cnx.autocommit() Okay, the error is horrible, this should not happen, I'll check this. However, true, I'm not sure the adaptor for SQLite can be able to create a database, I'm not sure this can be easily done w/ pure python (I mean, no os.system()) --but it should raise accordingly, and this should be documented. I'll report when I correct this, thanks for the bug report. -- S=E9bastien. |