Also, since we dinstinguish between sqlobject.dburi and
sqlalchemy.dburi, shouldn't we dinstinguish between
<name>.sqlobject.dburi and <name>.sqlalchemy.dburi as well? Or, the
other way round, not make distinctions, and just call the setting
"dburi" for unnamed connections?
It seems database conmection handling needs to be somewhat refactored.
Or maybe there is just something I don't understand?
-- Christoph
Refactoring is indeed needed... Specially after we added SA to the game. The
first implementation is always "duplicate what exists and change names".
I belive the simplification (just 'dburi') is the best one, but this might not
make it clear what is the ORM in use. I.e., how to decide which code path to
go if you have only "dburi='postgres:localhost:5432:/db_name'"? Is this SO
or SA that should be used? We can add other parameters, but then this
becomes:
if orm == 'sqlobject':
so.start.conn(dburi)
elif orm == 'sqlalchemy':
so.start.conn(dburi)
elif ...
And things start getting more complicated to test and check with multiple
decision points.
Using a package makes some things easy: adding a new ORM? Add a new package
and implement the same methods existing for other ORMs (i.e., copy & edit).
--
Jorge Godoy <jgo...@gmail.com>
I created a task ticket:
http://trac.turbogears.org/ticket/1813
Chris