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

Round-trip AUTOINCREMENT in SQLite parser #158

Merged
merged 1 commit into from
May 21, 2023

Conversation

nrdvana
Copy link
Contributor

@nrdvana nrdvana commented May 8, 2023

Currently, the SQLite parser sees the AUTOINCREMENT keyword and sets the column flag is_auto_increment, but the SQLite Producer will not write the AUTOINCREMENT keyword unless extra.auto_increment_type is 'monotonic'. This breaks round-trip by the AUTOINCREMENT keyword getting lost.

This was mentioned as a needed related fix in the discussion of #47, but it seems to have never been added.

Currently, the SQLite parser sees the AUTOINCREMENT keyword and sets
the column flag is_auto_increment, but the SQLite Producer will not
write the AUTOINCREMENT keyword unless extra.auto_increment_type is
'monotonic'.  This breaks round-trip by the AUTOINCREMENT keyword
getting lost.
Copy link
Contributor

@rabbiveesh rabbiveesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good;
Is this how this is handled in the other parsers?

Copy link
Contributor

@rabbiveesh rabbiveesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good;
Is this how this is handled in the other parsers?

@nrdvana
Copy link
Contributor Author

nrdvana commented May 19, 2023

The auto_increment_type is only relevant to SQLite, so the other parsers and producers don't operate on it. SQLite gives you auto-generated primary key integers that are not guaranteed to be monotonically increasing unless you specify the AUTOINCREMENT keyword. DBIC originally just used the default non-monotonic SQLite behavior for columns declared as auto_increment, and then needed an extra flag to differentiate for when users really need the monotonic behavior. The issue 47 I referenced added the flag to the producer, but not the parser.

@rabbiveesh rabbiveesh merged commit 39e00ab into dbsrgits:master May 21, 2023
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.

None yet

2 participants