Re: [sqlalchemy] Supplying a custom autoincrement value in custom dialects

2018-01-07 Thread Florian Apolloner
As an addition to the previous mail: I am going full circles here. If I add: ``` def get_insert_default(self, column): if (column.primary_key and column is column.table._autoincrement_column and column.default is None or (isinstance(column.default, sche

Re: [sqlalchemy] Supplying a custom autoincrement value in custom dialects

2018-01-07 Thread Florian Apolloner
On Sunday, January 7, 2018 at 12:07:13 AM UTC+1, Mike Bayer wrote: > > 1. will you always use sequences? > No, my dialect tries to use sequences only when the are explicitly specified, otherwise it tries to use SERIAL. So: Column('id', Integer, Sequence('some_id_seq'), primary_key=True) uses

Re: [sqlalchemy] Supplying a custom autoincrement value in custom dialects

2018-01-06 Thread Florian Apolloner
On Saturday, January 6, 2018 at 8:53:41 PM UTC+1, Mike Bayer wrote: > > 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

[sqlalchemy] Supplying a custom autoincrement value in custom dialects

2018-01-06 Thread Florian Apolloner
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, primar

Re: [sqlalchemy] group by and order by aliasing on custom dialects

2018-01-05 Thread Florian Apolloner
, January 4, 2018 at 10:30:50 PM UTC+1, Mike Bayer wrote: > > Please see the merges: > > https://gerrit.sqlalchemy.org/622 > https://gerrit.sqlalchemy.org/621 > > which should resolve both of these. > > > > On Thu, Jan 4, 2018 at 10:37 AM, Mike Bayer > wrote

[sqlalchemy] group by and order by aliasing on custom dialects

2018-01-04 Thread Florian Apolloner
Hi there, I am writing a custom dialect and sqlalchemy currently generates a statement like this: ``` SELECT count(some_table.id) AS count_1, some_table.x + some_table.y AS lx FROM some_table GROUP BY some_table.x + some_table.y ORDER BY lx ``` As you can see it uses the alias lx in ORDER BY b