Releases: Lighter-swift/Lighter
Stringly? Dates
By Default
This release fixes issues #27 and #33.
Enlighter was generating a copy phase to place the resources into the target bundle, because Xcode originally didn't do that. This resulted in a conflicting copy phase in the build system. Which could be worked around by removed the .db/.sql as an explicit resource file of the project.
This is now fixed for Xcode 16+. Enlighter now lets Xcode do the copying.
Further, default values have always been reported as strings. E.g. this:
DEFAULT 'Hello'
Would end up as the expression 'Hello'
, not as a parsed Hello
string (e.g. in the constructor of the model structure). This has been improved a lot as described in #33, but still has some open ends for String-current-time conversions.
Decimal-not
This release adds a Swift 6 Package manifest and fixes some imports to allow Xcode 16b6 builds.
It disables Decimal
as a value type due to NSDecimalString
crashing the compiler: #31
Batchably
The main release feature is that batch inserts and updates are not re-preparing the SQL statement (they just get rebound). That provides a significant speedup for those operations.
It results in a minor API change, the API now requires a Collection, a Sequence is not sufficient anymore. Shouldn't affect any code.
Also:
- fixes a SQL bug that could happen when triggers have a trailing comment (e.g.
CREATE TRIGGER (...) -- this and that
) - Adjusted the macros for the new URL based plugin API in Swift 6 (removes deprecation warnings in Xcode 16b)
More Concurrent
Add a Package.swift for Xcode 16 beta 1.
Should compile in Swift 6 mode.
The plugins show deprecation warnings in Xcode 16, but should still work nevertheless.
Almost Strictly Concurrent
This enables strict Swift concurrency checks on Swift 5.10 and later.
Most things in Lighter (raw or not) are Sendable
conceptually since it is all value types and properties are restricted to base types.
The one thing that had to be done is marking KeyPath
's on Sendable
types also Sendable
. This is key to the non-raw Lighter API. And apparently that will be fixed in Swift 6.
Dately
Immediately
As a follow-up to the excellent Optimizing SQLite for servers article, this release has a more impactful change in that it opens non-readonly transactions in the IMMEDIATE
mode.
The problem w/ DEFERRED
transactions is that they don't honour the busy handler, i.e. will fail w/ SQLITE_BUSY
immediately on upgrades.
As a result, it is more important to explicitly use readTransaction { tx in }
when only doing reads. Previously w/ DEFERRED
, one could still use transaction
w/ read-only behaviour.
The old mode can still be used by specifying the mode manually, e.g. transaction(mode: .deferrred) { tx in ... }
.
Visionary
Finding Nemo
Better resource lookup contributed by @micampe. Thanks!