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.