mdipierro/web2py — pull request #16 by adesst (2012-03-28 06:04:54+00:00)
Title: DAL and Schema/Database descriptor, as request on http://groups.google.com/group/web2py/browse_thread/thread/40ce800177e6ae3c/c343765565744f14?show_docid=c343765565744f14

MyDAL
======

Is an extend of DAL, that supports schema/database descriptor
of Oracle and PostgreSQL

Usage how to:
1. Use db = MyDAL('...') instead of DAL('..')
2. define table as usual,
set migrate to false (if the table is about to use schema, you leave
the migrate to Table.set_schema()),
and add db.tablename.set_schema('my_schema.') don't forget to add '.'
at the end of the descriptor.

e.g
from mydal import MyDAL, MyTable

db = MyDAL('oracle://myapp/myapppass@xe')

db.define_table('sub_gl',
Field('code'),
Field('description'),
migrate=False, # this is a must or the set schema will failed
)
db.sub_gl.set_schema('gl_app.',migrate=True, _adapter=db._adapter)