On Apr 30, 2011, at 3:13 AM, Kuze wrote:

> 
> I've a hunch that perhaps it's only indexes which would not need to be
> defined with SQLAlchemy cause they need not be created, but willing to
> see what others have to add.

The minimal metadata needed for SQL expression usage, and following that the 
ORM, are - the table names, the column names within those tables in which you 
care about, the datatypes of those columns (the length of CHAR and VARCHAR is 
not needed, however the precision/scale of Numeric and Float are recommended), 
whether or not each column has a "server default" that you care for the ORM to 
fetch after an INSERT (the text of the default does not matter).    You will 
also want primary key constraints for all tables that are to be mapped (use 
primary_key=True for this on a column), and foreign key constraints for those 
columns where you'll be defining some kind of relationship.   If you are on 
Oracle or Firebird, the names of sequences to be used must be associated with 
primary key columns via "Sequence()".  unique constraints, check constraints, 
and indexes are not needed.

You also need not consider metadata.create_all() to be the only means to 
generate a schema from table metadata.    I hand off SQL scripts to my DBA and 
I use a recipe such as 
http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring
 to generate the initial form of those scripts.


> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to