Hi @all,
finally I got some time to start coding what I call "support for funny names".
We discussed this - I think - briefly before, and I said that I would have committed some time to it.
Well, the moment is arrived. Purpose of the "greatest patch of them all" is to cleanly separate model from underlying backend structure, meaning that you can have a
db.table.field that maps "transparently" to
whatever$the heck.isthiscorrect,you're.insane in any "raw" interaction with the db itself.
Admittedly, I started just with table names, so ATM DAL passes all unittests mapping
db.table.field to whatever
whatever$the heck.isthiscorrect,you're.fieldWhen I'll have this finished, I see instantly this "niceties":
- working with legacy tables just got better
- users needing to "obscurate" real table names can do that
- users needing to observe some sort of naming convention for db tables (like, all tables starting with
t_) can save lots of typing
- general code shortings, and possibility to map better to "some object oriented quasi-ORM" paradigm, being able to do
db.persons.name == 'a' and let it transparently map to public.t_webapp_persons.full_name
- reserved_keywords can be used for either table names or field names
- intra-db (for MSSQL-like backends) and/or intra-schema (Postgresql comes to mind) queries
This is achieved - as discussed before, autoquoting an unquoted string leaves out some of the previously mentioned queries, but can be very well added as Yet Another Additional Feature - passing the RAW QUOTED tablename string to the table definition.
Code example
db.define_table('easy_name',
Field('name'),
rname='
"this is the easy_name table"')
Now...as said earlier all current tests in test_dal.py with just the "funny table name" support are passing without hiccups. Additionally, I'm replicating most of those tests adding the "funny name" alternative and seeking that they pass too.
Who fiddled previously with dal.py knows that its kinda of a nightmare, every corner you touch leads to side-issues ^_^
What I'm asking to you is: e.g. I faced a gnarly issue with select(left=) that I predicted would be a particular PITA ... do you foresee any complication with a particular piece of DAL code ?
Are you confident that if test_dal.py passes (and the one's I'm replicating just adding "rname=somethingstrange" to all table definitions) there will be further issues in the framework ?