Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IDENTITY columns #42

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Support for IDENTITY columns #42

merged 2 commits into from
Apr 11, 2024

Conversation

hab6
Copy link
Contributor

@hab6 hab6 commented Apr 11, 2024

Description

Ingres Connector enhancement providing support for identity columns for use with Ingres databases.

SQLAlchemy Full Test Suite Results

Note: These results exclude several test scripts containing a handful of individual tests that hang.

Configuration:
Ingres 11.2 build 15807 on Windows 10
Python 3.10.7
mock              5.1.0
pluggy            1.4.0
pyodbc            5.1.0
pypyodbc          1.3.6
pytest            8.1.1
SQLAlchemy        2.0.29.dev0
sqlalchemy-ingres 0.0.7.dev1
tox               4.14.2
Result Total Tests Passed Failed Errors Skipped Warnings Run Time
Before Changes 17568 11737 1316 2765 2077 5 19m 32s
After Changes 17568 14444 485 665 2133 5 21m 26s
Delta - 2707 (831) (2100) 56 - 1m 54s

Tests that hang with the code changes in place

The following specific tests of the SQLAlchemy test suite encounter an error without the Ingres connector code changes but now hang with the code changes.

Test Before Code Changes After Code Changes
VersioningTest::test_save_update
(test\orm\inheritance\test_basic.py)
ERROR: No value specified for mandatory column 'id' Hang
PartialFlushTest::test_o2m_m2o
(test\orm\test_cascade.py)
ERROR: No value specified for mandatory column 'id' Hang
MapperEventsTest::test_merge
(test\orm\test_events.py)
ERROR: No value specified for mandatory column 'id'. Hang
SessionTransactionTest::test_transactions_isolated
(test\orm\test_transaction.py)
ERROR: No value specified for mandatory column 'id' Hang
AlternateGeneratorTest::test_child_row_switch_two
(test\orm\test_versioning.py)
Hang
(same result with or without the code changes)
Hang
(same result with or without the code changes)

Test scripts that produce worse results with the code changes

The full SQLAlchemy test suite of 17K+ tests was run (excluding the above noted hanging tests) with and without the code changes and results of the ORM related tests were scrutinized. Most ORM test scripts produced better results with the code changes than without the changes. A handful of ORM test scripts produced minor ambiguous results (e.g. fewer errors offset by more skipped tests) and a few test scripts showed very minor worse results with the code changes.

Tests that perform worse with the code changes due to hanging or errors will be dealt with apart from this PR.

Caveat on using IDENTITY columns with X100 tables

Sequences, including identity columns, work for X100 tables only in specific circumstances and are not recommended for X100 tables. See documentation for additional details.

@clach04
Copy link
Member

clach04 commented Apr 11, 2024

WIP - not yet ready for review, @hab6 working on this at the moment.

@hab6 hab6 requested a review from clach04 April 11, 2024 17:11
@clach04
Copy link
Member

clach04 commented Apr 11, 2024

👍 lgtm.

Thanks for documenting the SQLAlchemy version.

Caveat on using IDENTITY columns with X100 tables

I recommend warnings be raised if identity columns are used (for DDL only?) and this is an x100 backend. On the fence whether this is a new ticket or something to tackle now (happy to defer).

RE hang/ERROR: No value specified for mandatory column 'id' I think that needs to be the next focus.

I proposed this be squash merged. Any concerns?

@hab6
Copy link
Contributor Author

hab6 commented Apr 11, 2024

Thanks @clach04 for the review and comments.

I will proceed to squash merge this PR and open a couple of new issues for:

@hab6
Copy link
Contributor Author

hab6 commented Apr 11, 2024

Internal tracking II-13847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants