github Lighter-swift/Lighter 1.0.8
Initially

latest releases: 1.4.12, 1.4.10, 1.4.8...
3 years ago

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)

Don't miss a new Lighter release

NewReleases is sending notifications on new releases.