Closed DanielTatarkin closed 6 months ago
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
Semi-related issue #494
Hi,
Thank you for your contribution 💪
Pls provide test cases proving correctness of proposed solution.
Example test case could look like this
def test_table_create_order(): metadata= MetaData() table = Table("test_table", m, Column("pk", Integer, Identity(start=1, increment=1, order=True))) ddl_schema = schema.CreateTable(table) res = _schema.compile(dialect=SnowflakeDialect()) expected = "..." assert res.string == expected, res.string
@sfc-gh-mraba thank you for the example, I added a unit test to tests/test_sequence.py (test_table_with_identity), let me know if the location is appropriate.
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes #436
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
CREATE TABLE DDL supports optional
ORDER | NOORDER
value forAUTOINCREMENT | IDENTITY
sequences on a column. Before this change, using a column with a sequence likeColumn(NUMBER, Identity(start=1, increment=1, order=True)
would default to session parameter NOORDER_SEQUENCE_AS_DEFAULTTRUE
by default which would always setNOORDER
instead of what is being set in the column definition.For us, this lead to discrepancies between ORM defined models and the Snowflake state seen by Alembic.