For this one, assuming you're using metadata.create_all() and not an alembic migration, the CreateColumn DDL construct gives you a hook for this kind of thing:

http://docs.sqlalchemy.org/en/rel_1_0/core/ddl.html?highlight=createtable#sqlalchemy.schema.CreateColumn

in the example there you can see it's looking for a flag in column.info. So your column would be like this:

Column('some_col', nullable=False, info={"oracle_not_null": False})

then in your @compiles recipe look for column.info['oracle_not_null'] while at the same time looking at compiler.dialect.name == 'oracle'.



On 04/22/2016 07:29 AM, Piotr Dobrogost wrote:

As Oracle does not support inserting empty string into NOT NULL column I
would like to declare specific column as nullable only for Oracle.
How can I do this?

Regards,
Piotr Dobrogost

--
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
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to