Proposal: DAL namespaces

7 views
Skip to first unread message

Robin B

unread,
Jan 17, 2009, 11:02:17 PM1/17/09
to web2py Web Framework
Tablenames should be conveniently namespaced with the application's
name, so that applications do not clobber eachother's tables.

db=GQLDB(namespace=request.application)
db.define_table('posts')
db.posts._tablename --> welcome___posts

Using db.posts is much nicer than db.welcome___posts, especially when
someone installs an application under a different name, because you do
not need to modify the code.

Namespaces in the DAL could also be used to explicitly control whether
specific tables are intended to be private or shared between apps (eg.
t2).

Do any of the SQL drivers do anything similar already?

Robin

mdipierro

unread,
Jan 18, 2009, 1:52:26 AM1/18/09
to web2py Web Framework
Let me think about this. I like the idea but it does not look easy.
Reply all
Reply to author
Forward
0 new messages