Hi,
I am trying to use my ORM mapping definitions to create my database
schema and I'm looking at the defaults values.

Apparently when I defined a column, if I use default_server='value' it
will get into the DDL for my DB, but then my object instances will not
have a default value when I instantiate them.

While if I use the default=value it will be used in my instances to
set a default but it will not be used when creating the DDL for my DB.

So basically to define a default I have to use both:
default=1024, default_server='1024'
or
default=None, default_server=text('NULL')

Is this correct or I am missing something?

Why for simple values (like number) default is not enough?


Thanks for your help,
Luca


PS: my code is still using both ORM query and plain SQL query
PPS: for some reason I'm using a mock engine to generate the DDL:
def dump(sql, *multiparams, **params):
    print sql.compile(dialect=engine.dialect)

engine = sqlalchemy.create_engine('mysql://', strategy='mock', executor=dump)

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to