Oleg...
Thanks for this! I'm just getting back to it now...
(For those that don't remember the original message, I want to dump my whole
database as text or yaml or json or whatever....basically I'm writing my own
mysqldump).
So you've given me step one and it works well. Thank you.
tables = connection.queryAll('show tables')
for table in tables:
print "\t", table[0]
Now I know step three is something like this:
recdict = record.sqlmeta.asDict()
But I can't figure out how to go from step one to step three. Given the
table name as a string, how do I convert it to an object where sqlobject
goes and creates an object based on the info in the database?
Thanks again!
On Tue, Mar 25, 2008 at 6:00 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> On Tue, Mar 25, 2008 at 05:24:10PM -0300, Sam's Lists wrote:
> > My first silly question is how can I, using sqlobject, find the names
> of
> > all the tables in my database.
> >
> > (A related question...can I find the names of all the databases as
> well?)
>
> There is no way in SQLObject. SO assumes you know your database and
> tables. You can draw the scheme for a table from DB but you have to know
> the table's name in advance.
>
> Of course you can add such feature to SO. The query in MySQL is
> SHOW TABLES, in SQLite it is
> SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;
> and in Postgres it is something like SELECT c.relname FROM pg_class c,
> pg_type t WHERE c.reltype = t.oid AND t.typname = 'table';
>
> Oleg.
> --
> Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
> Programmers don't die, they just GOSUB without RETURN.
>
> -------------------------------------------------------------------------
> 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
> sqlobject-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss