Can you confirm the exact sql and parameters you are seeing?  SQLAlchemy
never sends NULL for an auto increment id column, it omits it from the
statement so that the default takes place, which I assume is what you mean
by "leave it out".

On Jan 6, 2018 1:52 PM, "Florian Apolloner" <f.apollo...@gmail.com> wrote:

> Hi,
>
> Informix mostly follows the Postgresql behavior when it comes to SERIAL
> columns with one notable exception: I have to specify 0 (0 as int, not
> NULL) for a SERIAL column on insert or leave it out.
>
> Code like:
> ```
>         Table('date_table', metadata,
>               Column('id', Integer, primary_key=True,
>                      test_needs_autoincrement=True),
>               Column('date_data', cls.datatype),
>               )
>         config.db.execute(
>             date_table.insert(),
>             {'date_data': None}
>         )
> ```
>
> currently fails because 'id' is NULL. Can I somehow tell SQLAlchemy to use
> an implicit default of 0 for those inserts?
> (My dialect also follows the behavior of setting integer columns to serial
> if they are primary keys and have no defaults…)
>
> Thanks,
> Florian
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> 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.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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