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

Reply via email to