-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Modernize SQLite feature support #100
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Nov 11, 2022
…onfusing whitespace and simplifying most of the content. Adds a `customDataType(for:)` override to handling requests for bigint types and switches from plain `?` for placeholders to SQLite's numbered `?NNNN` representation per SQLite docs recommendation.
…SQLiteDatabase, and use it to enable version-dependent RETURNING and UPSERT support for SQLite.
d71e876
to
53db258
Compare
0xTim
approved these changes
Nov 12, 2022
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
=======================================
Coverage ? 65.76%
=======================================
Files ? 7
Lines ? 295
Branches ? 0
=======================================
Hits ? 194
Misses ? 101
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. |
These changes are now available in 4.2.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following changes have been made:
SQLiteDatabase
now vends the version of SQLite in use per theSQLDatabaseReportedVersion
protocol.UPSERT
syntax is now available for SQLite when the runtime library version is new enough (3.24.0 or newer)RETURNING
syntax is now available for SQLite when the runtime library version is new enough (3.35.0 or newer)?NNN
syntax is now used instead of plain?
placeholders..bigint
(viaSQLCreateTable
or Fluent'sSchemaBuilder
) now map explicitly to theINTEGER
type name, which has the same data size but will correctly enable auto-increment behavior if the column is a table's primary key (previously this only worked when specifyingSQLDataType.int
or Fluent equivalent).These changes depend on vapor/sqlite-nio#34.