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

Remove unnecessary AUTOINCREMENT from example #1891

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

thecashewtrader
Copy link
Contributor

Firstly, thanks for the great project.

According to the sqlite documentation, the AUTOINCREMENT keyword shouldn't be used in normal cases:

The AUTOINCREMENT keyword imposes extra CPU, memory, disk space, and disk I/O overhead and should be avoided if not strictly needed. It is usually not needed.

On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an unused integer, usually one more than the largest ROWID currently in use. This is true regardless of whether or not the AUTOINCREMENT keyword is used.

Firstly, thanks for the great project.

According to (the sqlite documentation)[https://www.sqlite.org/autoinc.html], the `AUTOINCREMENT` keyword shouldn't be used in normal cases:

> The AUTOINCREMENT keyword imposes extra CPU, memory, disk space, and disk I/O overhead and should be avoided if not strictly needed. *It is usually not needed*.
> On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an unused integer, usually one more than the largest ROWID currently in use. *This is true regardless of whether or not the AUTOINCREMENT keyword is used*.
@kyleconroy kyleconroy merged commit a5d4ed9 into sqlc-dev:main Oct 11, 2022
akutschera pushed a commit to akutschera/sqlc that referenced this pull request Nov 10, 2022
Firstly, thanks for the great project.

According to (the sqlite documentation)[https://www.sqlite.org/autoinc.html], the `AUTOINCREMENT` keyword shouldn't be used in normal cases:

> The AUTOINCREMENT keyword imposes extra CPU, memory, disk space, and disk I/O overhead and should be avoided if not strictly needed. *It is usually not needed*.
> On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an unused integer, usually one more than the largest ROWID currently in use. *This is true regardless of whether or not the AUTOINCREMENT keyword is used*.
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