Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-30 Thread Павел Фролов
Mike, fist of all thank you a lot for your answers - it works for me now, but I found issue case (it was necessary to test more thoroughly and describe the libraries, I use latest sqlalchemy and alembic) so problem was when I had UniqueConstraint instead of PrimaryKeyConstraint. *#

Re: Use events with expression api

2020-09-30 Thread Mike Bayer
SQL expressions are intercepted by the SQL Execution events described at https://docs.sqlalchemy.org/en/13/core/events.html#sql-execution-and-connection-events and the main ones are before_execute() and before_cursor_execute(), but it depends on what you want to do.if you want to change how

Use events with expression api

2020-09-30 Thread brian...@blue-newt.com
Is there a way to use events with the expression api? I see how they're used with ORM and Core but not expressions. Thanks, Brian -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails

Use events with expression api

2020-09-30 Thread brian...@blue-newt.com
Is there a way to use events with the expression api? I see how they're used with ORM and Core, but not expressions. Thanks, Brian -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails

Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-30 Thread Mike Bayer
I just ran your test case, it generates BIGSERIAL, no warning is emitted because I don't include primary_key=True on the column. Can you ensure SQLAlchemy is on latest 1.3 version and try the below MCVE? if you can modify it to show your problem that would help. import sqlalchemy as sa from

Re: Stray changes detected only sometimes with revision --autogenerate

2020-09-30 Thread Daniel Krebs
Hi Mike, I adapted our setup to the new cookbook recipe and it basically fixed both problems! I don't need to maintain my patches anymore (thanks to setting `connection.dialect.default_schema_name`, this did the trick!) and the detected stray changes are also gone. I did some investigation

Re: [sqlalchemy] postgresql: force create SERIAL without primary key

2020-09-30 Thread Mike Bayer
oh other way around, you want BIGSERIAL make yourself a BIGSERIAL type. from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import Table from sqlalchemy import types as sqltypes class