Skip to content

Releases: Lighter-swift/Lighter

Stringly? Dates

26 Oct 20:14
da5d178
Compare
Choose a tag to compare

This release should fix issue #37, a code generation issue w/ optional dates that are serialised as Strings.

It also makes some Sendable, static default properties lets again (had been converted to var to workaround Sendability issues.

By Default

03 Oct 17:35
212e3aa
Compare
Choose a tag to compare

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

22 Aug 12:33
4fd43bb
Compare
Choose a tag to compare

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

30 Jun 14:50
f5a0bf1
Compare
Choose a tag to compare

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

18 Jun 15:45
f033ff1
Compare
Choose a tag to compare

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

07 Apr 20:21
cbf71d0
Compare
Choose a tag to compare

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

07 Apr 12:13
c33488d
Compare
Choose a tag to compare

Bugfix: Was encoding Data columns as Date's 📅.

E.g.

CREATE TABLE app (
  app_id UUID NOT NULL PRIMARY KEY,
  icon Data
)

Would turn into

struct App {
  var id   : UUID
  var icon : Date? // <== instead of `Data` when Foundation is enabled in the generator
}

Immediately

01 Apr 05:33
f64e06e
Compare
Choose a tag to compare

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

19 Mar 13:34
13d1016
Compare
Choose a tag to compare

Xcode 15.3 / Swift 5.10 manifest, explicit support for more platforms in that Package.swift.

Finding Nemo

10 Oct 14:35
c016296
Compare
Choose a tag to compare

Better resource lookup contributed by @micampe. Thanks!