Re: [Modeling-users] few misc issues with sqlite adaptor
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-08-09 11:48:35
|
Mario Ruggier <ma...@ru...> wrote: > On Jeudi, ao=FB 7, 2003, at 23:41, Sebastien Bigaret wrote: > > Mario Ruggier <ma...@ru...> wrote: > >> a few points, encountered when trying to make a pymodel, > >> running the mdl_* scripts, and using SQLite adaptor: > >> > >> 1. when running mdl_validate_model on a pymodel that > >> does not hard-wire an adaptorname: > >> > >> * Warning(s): > >> - Can't find concrete adaptor: can't check SQL types > > > > True, when it cannot be found they cannot be checked, so we warn the > > user. >=20 > The point I was hinting ;) at is that in this case shouldn't mdl_validate > select the adaptor pointed to by the "foremost" cfg file? I don't think I will support this. The connection dictionaries can be supplied within a model and/or in a file pointed by environment variable MDL_DB_CONNECTIONS_CFG. I think this is enough, and that this scheme shouldn't be complicated. > >> 2. when running mdl_validate_model on a model that > >> uses "text" as externalType (using SQLite adaptor): [...] > > > > Should be fixed. >=20 > Filed as bug 785432. Fixed in CVS, see bug report and attached patch. > >> 3. When running mdl_* utility scripts, the main cfg (pointed to by env > >> var MDL_DB_CONNECTIONS_CFG) is not taken into account. > >> Same goes for when an Adaptorname.cfg is made available in the > >> same directory as the pymodel. > > > > True, no matter where a .cfg is, if it's pointed to by MDL_DB_CONNECTIO= NS_CFG > > it should taken into account. This is a bug. >=20 > Ehm, on closer looks I would have to take this back. > Generate_db does take this into account. Validate does > not... I have not determined of all the cases when it does or > does not though... I will file as "mdl_* scripts do not always take .cfg = into > account", > or 785436. I'm sorry, I tried but cannot reproduce the bug here, I need more info. > In addition to this problem, I feel it would be convenient (and safe) to > make it such that either (a) commandline switch to specify a "test" cfg > whenever desired, and/or (b) use a local cfg if one is present (by which > name?). > This to prevent overwriting real db files while testing changed models. I understand what you say, but as I said above I do not feel like complicating things here. It's impossible to foresee every possible situations where valuable data could be lost, and I have the feeling that trying to find more and more of these situations could lead to the wrong feeling that the script is safe, while complicating the everyday's life of developpers.=20 Right, mdl_generate_DB_schema.py should be handled with care, just like 'DROP' statements when connecting to a database, or shell's 'rm' when speaking of sqlite files... Does it make sense? > >> 4. When running mdl_generate_DB utility script, and specifying a > >> --admin-dsn on the command line, and the db name in this dsn is > >> different than the db name specified in the pymodel, then an empty > >> file with the dsn_db name is created, and a proper sqlite db fis > >> created in a file with the pymodel_db name. > > > > Ok, this could be checked by mdl_generate_DB. >=20 > Bug 785434. Fixed in CVS, and the corresponding patch is attached to the bug report. Cheers, -- S=E9bastien. |