ok, great. if you want to look at the code, its pretty easy, its lib/
sqlalchemy/databases/mysql.py line 163, "reflecttable". Right now
its just "describe", loop through rows, a little parsing, then
table.append_item(Column). thanks !
- mike
On Feb 5, 2006, at 1:57 PM, Alastair Houghton wrote:
On 5 Feb 2006, at 18:20, Michael Bayer wrote:
I see that. Well, heres the questions:
1. do we want to make InnoDB the default when MySQL creates
tables ? Do we ever want to use myISAM ?
I think it would make sense to make InnoDB the default. It's
stable enough that it's apparently the default table type on some
of the Windows versions of MySQL now.
2. if both are needed, how about a "use_innodb" or "use_myisam"
option to create_engine with mysql...which is the default? :
# if myisam is the default
x = create_engine('mysql://user=foo&etc..', use_innodb=True)
# if innodb is the default
x = create_engine('mysql://user=foo&etc..', use_myisam=True)
It *would* be nice to be able to choose the table type; MySQL
currently supports several different table types, and I can imagine
that someone somewhere will want to use one of the others (the
cluster and BDB table types are probably the most useful of the
"alternative" types, although there's also the MEMORY type for when
you want very fast access).
I think it should be a string argument; that way SQLAlchemy will
always support anything MySQL does.
3. same thing, use_innodb/use_myisam keyword arguments on Table
() ? im pretty sure its a yes on this at least...
Yes, I think so.
4. Well the docs are pretty clear, the only ways to get at those
foreign keys from a describe is via SHOW CREATE TABLE or a SHOW
TABLE STATUS, each of which require some regular expression
wizardry and close-watches on changes in string syntax from
version to version to get at them.
a. do we want to use the current DESCRIBE/SHOW TABLE STATUS to
reflect tables, or just SHOW CREATE TABLE (I sort of like SHOW
CREATE TABLE since its one-stop shopping) ? do we want to use one
for myISAM and the other for InnoDB ?
b. is anyone using MySQL 5 yet ? do InnoDB users genrally use
MySQL 5 or is 3/4 support just as important ? should we deal at
all with mysql5's information_schema support or its better to just
do something that works for all 3 versions ?
Well I'm using MySQL 4. I don't plan on shifting to 5 any time
soon. I doubt anyone cares about MySQL 3.
c. does anyone want to take a crack at this ? just a single
function - i.e. I give you a SHOW CREATE TABLE, you give me a list
of columns, types, foreign keys, INNODB status, etc.
If you can point me at an example somewhere in the code of
something that generates the right sort of output, or give a
description of the output you want (preferably with examples), I
might give it a bash.
Kind regards,
Alastair.
--
http://www.alastairs-place.net
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users