-
Notifications
You must be signed in to change notification settings - Fork 1
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
SQLAlchemy: Use server-side now()
function for "autoincrement" columns
#24
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
964fccb
to
e251ef8
Compare
now()
function for "autoincrement" columns
e251ef8
to
628b97c
Compare
That's a fluke, possibly because of too less granularity in the time domain when only using millisecond resolution. However, this visited the test suite on CI already on a previous occasion, see crate/crate-python#11, so it is not holding me back on merging this. |
Does |
It will have the same guarantees what the relevant DBMS has to offer. In the case of PostgreSQL, it is implemented by its "sequences" subsystem. I think it will guarantee one the highest levels of uniqueness, because, as a feature typically used for generating primary keys, it is used by all kinds of DBMS all over the world for this purpose.
You are right, but this is not unlikely at all, and can easily be invoked by corresponding test cases simulating high concurrency, what MLflow actually does, that's why it is occasionally tripping. This is why I also was proposing an alternative client-side approach with microsecond resolution at crate/sqlalchemy-cratedb#77, to lower the chance of collisions. However, in this case, the outcome doesn't show any significant difference, and works in 95% of the test runs. |
628b97c
to
b1c04d6
Compare
Another test run on this patch worked well, so it can't be that wrong. |
Now uses the server-side
now()
function to patch column models using the "autoincrement" property, as suggested by @seut at crate/sqlalchemy-cratedb#77. Thanks!