you might look at some of the backend code that sqalchemy uses to accomplish this... See: http://www.sqlalchemy.org/docs/05/metadata.html#reflecting-tables
Which will lead you to (in lib/sqlalchemy/schema.py) to MetaData.reflect() ==> Table.__init__() ==> reflecttable(); Many defined per specific db's (see lib/sqlalchemy/databases); reflecttable() seems to be dispatched from lib/sqlalchemy/engine/base.py, and digested in lib/sqlalchemy/databases.information_schema.py. Hopefully, the SQL in the reflecttable() of the individual database files will be helpful for starters. Regards, Yarko On Fri, May 8, 2009 at 11:38 AM, Álvaro Justen [Turicas] < [email protected]> wrote: > > On Fri, May 8, 2009 at 1:52 AM, Álvaro Justen [Turicas] > <[email protected]> wrote: > > I have plans to create a db.discover_tables() but it requires more > > work. I want to function discover tables automaticaly, to use in > > databases that weren't created by web2py. > > I implemented my idea (db.discover_tables()) and it is working good > for SQLite. I hope in some days it'll work fine in other databases. > > -- > Álvaro Justen > Peta5 - Telecomunicações e Software Livre > 21 3021-6001 / 9898-0141 > http://www.peta5.com.br/ > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

