On 04/22/2016 11:51 AM, Piotr Dobrogost wrote:
 >On Friday, April 22, 2016 at 5:02:17 PM UTC+2, Mike Bayer wrote:
 >
 >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:

Thanks for info. Yes, I'm using create_all() but eventually I'll have to
start using alembic. Are there any problems with using alembic in the
future while creating initial db schema with create_all()?

In Alembic I don't think directives like "add_column()" are currently taking advantage of the CreateColumn construct. create_table() should be however.


 >Column('some_col', nullable=False, info={"oracle_not_null": False})
 >
 >then in your @compiles recipe look for column.info
<http://column.info/>['oracle_not_null']
 >while at the same time looking at compiler.dialect.name
<http://compiler.dialect.name/> == 'oracle'.

I get it. However as we want this for every autoincrement column I guess
we can check for already provided "autoincrement" flag and avoid passing
column.info altogether. Nice.

It seems like this could be used to render IDENTITY keyword for
autoincrement columns for Oracle 12c which I asked about recently in my
post titled "Support for Oracle 12c auto increment (IDENTITY) columns?"
(https://groups.google.com/forum/#!topic/sqlalchemy/Jg_kV6VF0_E).

yes, you can write whatever rendering you want in there.




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