Hi All,
I've got something I'd like to discuss with a broader audience.
My company *might* adopt SO for it's ORM-needs (if they actually agree on
there being a need...)
Now one thing we use here extensively in the postgres is schemas. I personally
don't care too much, but then they are a namespace-feature - which is a good
thing(tm), if you read
import this
Now - the question is if & if yes how we would could go at implementing these.
My suggestion:
- create an attribute on sqlmeta, defaulting to None
- whenever it is not None, prepend the schema-name to the table-name
- on databases that support schemas (postgres so far), do so with a . (dot)
as separator
- on all others, user _ (underscore)
Thus a declaration of an object could look like this:
class User(SQLObject):
class sqlmeta:
schema = "tg"
display_name = ...
As you can already see - it's something frameworks as e.g. TurboGears could
benefit from, as they currently rely on self-created namespaces by naming
their objects
class TG_User(...)
Additionally, one could think of adding some option that would enforce the _
as separator for all DBs, regardless of their support for schemas or not.
And of course adding schema support would mean that the create and drop
commands would have to take that into consideration - at least the create
should also create the schema.
There are also some subtleties regarding relations - however, these eventually
boil down to consistency & potentially new keywords.
Diez
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss