Releases: vapor/sqlite-kit
4.5.2 - Use structured logging (metadata) when logging queries
What's Changed
Use structured logging (metadata) when logging queries by @gwynne in #110
When a query is executed, the actual SQL query and its accompanying array of bound parameters (if any) are now logged as structured metadata on the logger using a generic message, rather than the query and bindings being the message. This follows the recommended guidelines for logging in libraries. Credit goes to @MahdiBM for the original suggestion.
Before:
2024-05-29T00:00:00Z debug codes.vapor.fluent : database-id=sqlite [SQLiteKit] SELECT * FROM foo WHERE a=?1 [["bar"]]
After:
2024-05-29T00:00:00Z debug codes.vapor.fluent : database-id=sqlite sql=SELECT * FROM foo WHERE a=?1 binds=["bar"] [SQLiteKit] Executing query
Reviewers
Thanks to the reviewers for their help:
This patch was released by @gwynne
Full Changelog: 4.5.1...4.5.2
4.5.1 - Fix a DocC warning and update SQLiteNIO required version
What's Changed
Fix a DocC warning and update SQLiteNIO required version by @gwynne in #109
One can’t use symbol links across modules. Also requires the most recent SQLiteNIO, since we made changes based on improvements therein in the last PR.
This patch was released by @gwynne
Full Changelog: 4.5.0...4.5.1
4.5.0 - Leverage improvements in SQLKit and SQLiteNIO
What's Changed
Leverage improvements in SQLKit and SQLiteNIO by @gwynne in #108
Several improvements:
- Adds full
Sendable
correctness, including taking advantage of the improvements in vapor/sqlite-nio#68- Adds
ExistentialAny
compliance- The minimum Swift version is now 5.8
- Fully supports the new SQLKit functionality added in SQLKit 3.29.0.
- Modernizes the README and API documentation. API docs now have 100% coverage.
- Custom JSON encoders and decoders can now be specified per-connection.
- SQLKit’s
queryLogLevel
functionality is now fully implemented.- Database connections now default to using
NIOThreadPool.singleton
andMultiThreadedEventLoopGroup.singleton
unless otherwise specified.- Leverages the improvements from vapor/sqlite-nio#68 to improve performance of Concurrency-based APIs by reducing thread hops and excess allocations.
SQLiteDataEncoder
andSQLiteDataDecoder
are now slightly faster and behave more consistently.
This patch was released by @gwynne
Full Changelog: 4.4.2...4.5.0
4.4.2 - Handle JSON better
What's Changed
Handle JSON better by @gwynne in #107
This fixes an issue that arose with the release of SQLite 3.45.0, which includes support for a new “JSONB” internal representation. As a side effect, textual JSON data presented to SQLite as a BLOB is incorrectly treated as JSONB by the database, resulting in inexplicable errors when attempts are made to read the JSON back out again. Since we should always have been sending JSON to the database as TEXT in the first place, this is considered a general bugfix rather than purely a compatibility update.
Unblocks vapor/sqlite-nio#62.
Reviewers
Thanks to the reviewers for their help:
This patch was released by @gwynne
Full Changelog: 4.4.1...4.4.2
4.4.1 - Make nil decoding handling for SQLiteRows consistent with the other drivers
What's Changed
Make nil decoding handling for SQLiteRows consistent with the other drivers by @gwynne in #106
Dating back to the original release of Fluent 4, the MySQL and Postgres SQLKit drivers (mysql-kit and postgres-kit) have always returned
true
fromSQLRow.decodeNil(column:)
when the column is not present, whereas the SQLite driver has thrown an error. This PR finally brings SQLite in line with the others.
This patch was released by @gwynne
Full Changelog: 4.4.0...4.4.1
4.4.0 - Revise in-memory database handling for modern SQLite
What's Changed
Revise in-memory database handling for modern SQLite by @gwynne in #105
SQLiteKit has for a long time depended on the use of SQLite’s shared cache with in-memory databases to support opening multiple connections to such databases. However, SQLite has also for a long time specifically recommended the total omission of the shared cache, a recommendation which SQLiteNIO now follows as of vapor/sqlite-nio#51. Therefore, SQLiteKit now uses uniquely-named temporary files to emulate the feature when in-memory databases are requested.
Additional changes in this release:
Reviewers
Thanks to the reviewers for their help:
This patch was released by @gwynne
Full Changelog: 4.3.1...4.4.0
4.3.1 - Add SQLite support for nested subpath (JSON) expressions
This patch was authored and released by @gwynne.
Implements SQLKit's new SQLDialect.nestedSubpathExpression(in:for:)
method.
Update min Swift version to 5.6 and make platform versions consistent
This patch was authored and released by @gwynne.
4.2.1
Modernize SQLite feature support
This patch was authored and released by @gwynne.
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)- When emitting placeholders for bound parameters, the numbered
?NNN
syntax is now used instead of plain?
placeholders. - Requests to create columns of type
.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). - Dropped support for Swift up to and including 5.4, 5.5 is now the minimum.
- CI was heavily updated, with the same changes as were made to SQLiteNIO.
These changes depend on vapor/sqlite-nio#34.