set autoincrement=False in the Column definition
Column('id', BIGINT, autoincrement=False)
On Tue, Sep 29, 2020, at 3:49 PM, Павел Фролов wrote:
> Hi all,
>
> I need just autoincrement without primary key, like:
>
> CREATE TABLE test (
> id BIGSERIAL NOT NULL,
> run_id INTEGER NOT NULL
> );
>
> How it's do with sqlalchemy core?
>
> I tried:
>
> sa.Column('id', sa.BIGINT(), sa.Sequence('test_seq')),
> or
> sa.Column('id', sa.BIGINT(), autoincrement=True),
> ->
> id BIGINT,
> (no serial)
>
> I see in docs that autoincrement can be only with primary key.
>
> I asked docs and google - can not find solution.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sqlalchemy/4629a9b3-3a8e-47b8-8d9a-580242e81d9fn%40googlegroups.com
>
> <https://groups.google.com/d/msgid/sqlalchemy/4629a9b3-3a8e-47b8-8d9a-580242e81d9fn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/87f69f76-69be-4e87-9e12-b0850918f828%40www.fastmail.com.