Skip to content

Releases: Lighter-swift/Lighter

Carriage Returned

19 Sep 10:23
Compare
Choose a tag to compare

Fix for Issue #23, thanks go to @finestructure for reporting it. If the SQL to create a database contained carriage returns (CR, \r, ASCII 13), Enlighter wouldn't properly generate multiline string literals. This then break Swift compilation.

Fixed. Also converting CRLF to CRs, i.e. no more CRs in produced code.

Binaries Floating

17 Sep 13:08
93d883e
Compare
Choose a tag to compare

This version treats all Int types (Int8, UInt32 etc) as SQLite base values, i.e. they can be used in a schema. Also adds support for Float.

The Bool type can now process TEXT columns in a limited way (but always writes as Int64). It'll match textual bools using the first character (Yes, No, True, False, 0, 1 etc).

Finally, when using a RawRepresentable w/ an unmapped stored value, a proper Error is thrown (vs crashing in a forced unwrap).

Macroless

13 Jun 12:27
fa193d1
Compare
Choose a tag to compare

Just the regular Package.swift fix as new Swift versions are released.

FiveEight.2

17 Apr 22:45
Compare
Choose a tag to compare

Fix an Xcode 14.3/Swift 5.8 warning.

FiveEight

02 Apr 21:36
Compare
Choose a tag to compare

This should fix Issue #21, caused by the incorrect Package.swift to be picked up. I.e. make everything working right w/ Xcode 14.3 (aka Swift 5.8).

NOTify!

31 Oct 17:00
Compare
Choose a tag to compare

Recent Swift versions seem to be picky w/ ivar lifetimes in deinit's, when such are dispatched to different dispatch queues.
An attempt to fix that. Thanks @dasdom for reporting!

The Truth

04 Oct 22:23
Compare
Choose a tag to compare

Bool support was missing in Lighter as per issue #15. This release should fix the issue.

Backgrounds

10 Sep 14:15
fb35fea
Compare
Choose a tag to compare

As a convenience the simple pool now releases open SQLite connection when the application did enter background, on iOS. The pool collector now also captures the pool weakly, though that shouldn't matter much in practice.

Also added a few docs here and there.

INTeger

27 Aug 14:30
161ca45
Compare
Choose a tag to compare

The release improves SQLite compatibility wrt "rowid" primary keys, also called "INTEGER primary keys". If a column is declared as INTEGER PRIMARY KEY, SQLite will automatically push a row-id as the primary key if no explicit value is specified. Lighter already accounted for that.
It didn't distinguish that though from other integer columns, e.g. if specified as just INT. A column declared as INT PRIMARY KEY doesn't support the automatic key assignment (INTEGER must be spelled out).
This is now properly implemented in the schema reflection and addressed in the generator.

There is another fix related to the generation of plural names in the SQLite API, e.g. the generator generated names like taltents0 if the base name was plural already (and singularizeRecordNames is off, which is the default).

Initially

24 Aug 14:34
bdc3b91
Compare
Choose a tag to compare

New day, new release. 1.0.8 brings a few small fixes and conveniences.

UUID Primary Keys

When using UUID primary keys, like:

CREATE TABLE talent (
  talent_id UUID NOT NULL,
  name      TEXT NOT NULL
);

The generated code now generates a default UUID when none is specified, e.g.:

var talent = Talent(name: "Jason Bourne") // <= no explicit `id` necessary anymore
try db.insert(talent)

Integer Primary Keys

Similar to UUIDs, Integer primary keys improved and default to Int.min, e.g.:

CREATE TABLE person (
  person_id INTEGER PRIMARY KEY NOT NULL,
  name TEXT NOT NULL
);

Doesn't require the id to be specified anymore (it isn't used for INSERTs in any case!):

var person = Person(name: "Jason Bourne") // <= no explicit `id` necessary anymore
try db.insert(person)

Note: There is still a glitch in the form of issue #14. SQLite only does int-key things, if the column was created using INTEGER, e.g. INT doesn't work properly.

Issues fixed

  • Issue #13 (Generated comment incorrectly claims "has default)
  • Issue #11 (Code generated based on database creation SQL should not create module)
  • Issue #10 (Add a default for SQLite generated primary keys)
  • Issue #9 (Add a default for UUID primary keys)