Changelog History
Page 17
-
v0.80.0 Changes
๐ Released September 7, 2016
๐ Fixed
Database.tableExists()
learned about temporary tables
๐ New
๐ WatchOS support
QueryInterfaceRequest.deleteAll()
deletes database rows:try Wine.filter(corked == true).deleteAll(db)
-
v0.79.4 Changes
๐ Released August 17, 2016
๐ Fixed
- ๐ DatabasePool can now open an existing database which is not yet in the WAL mode, and then immediately read from it. It used to crash unless at least one write operation was performed before any read (fixes #102).
-
v0.79.3 Changes
๐ Released August 16, 2016
๐ Fixed
Table creation DSL accepts auto references with implicit primary key:
try db.create(table: "nodes") { t in t.column("id", .Integer).primaryKey() t.column("parentId", .Integer).references("nodes") }
๐ New
๐ Use SQLColumn of the query interface when extracting values from rows:
let nameColumn = SQLColumn("name") let name: String = row.value(nameColumn)
-
v0.79.2 Changes
๐ Released August 10, 2016
๐ Fixed
- โก๏ธ Persistable used to generate sub optimal UPDATE requests.
-
v0.79.1 Changes
๐ Released August 10, 2016
๐ Fixed
ColumnDefinition
check
andreferences
methods can now define several constraints:try db.create(table: "users") { t in t.column("name", .Text).notNull() .check { length($0) > 0 } .check { !["root", "admin"].contains($0) } }
โก๏ธ Persistable
update
,exists
anddelete
methods now work with objects that have a nil primary key. They used to crash.โก๏ธ The
update(_:columns:)
method, which performs partial updates, no longer ignores unknown columns.
-
v0.79.0 Changes
๐ Released August 8, 2016
๐ฅ Breaking Change
0๏ธโฃ Column creation method
defaults(_:)
has been renameddefaults(to:)
.try db.create(table: "pointOfInterests") { t in t.column("favorite", .Boolean).notNull().defaults(to: false) ... }
-
v0.78.0 Changes
๐ Released August 6, 2016
๐ New
๐ Upgrade sqlcipher to v3.4.0 (announcement, changelog)
๐ DSL for table creation and updates (closes #83, documentation):
try db.create(table: "pointOfInterests") { t in t.column("id", .Integer).primaryKey() t.column("title", .Text) t.column("favorite", .Boolean).notNull() t.column("longitude", .Double).notNull() t.column("latitude", .Double).notNull() }
๐ Support for the
length
SQLite built-in function:try db.create(table: "persons") { t in t.column("name", .Text).check { length($0) > 0 } }
Row adopts DictionaryLiteralConvertible:
let row: Row = ["name": "foo", "date": NSDate()]
๐ฅ Breaking Changes
Built-in SQLite collations used to be named by string: "NOCASE", etc. Now use the SQLCollation enum:
.Nocase
, etc.PrimaryKey has been renamed PrimaryKeyInfo:
let pk = db.primaryKey("persons") pk.columns // ["id"]
-
v0.77.0 Changes
๐ Released July 28, 2016
๐ New
Database.indexes(on:)
returns the indexes defined on a database table.Database.table(_:hasUniqueKey:)
returns true if a sequence of columns uniquely identifies a row, that is to say if the columns are the primary key, or if there is a unique index on them.โก๏ธ MutablePersistable types, including Record subclasses, support partial updates:
try person.update(db) // Full update try person.update(db, columns: ["name"]) // Only updates the name column
๐ฅ Breaking Changes
โก๏ธ MutablePersistable
update
andperformUpdate
methods have changed their signatures. You only have to care about this change if you customize the protocolupdate
method.protocol MutablePersistable : TableMapping { -func update(db: Database) throws +func update(db: Database, columns: Set<String>) throws } extension MutablePersistable { func update(db: Database) throws +func update(db: Database, columns: Set<String>) throws +func update<S: SequenceType where S.Generator.Element == SQLColumn>(db: Database, columns: S) throws +func update<S: SequenceType where S.Generator.Element == String>(db: Database, columns: S) throws -func performUpdate(db: Database) throws +func performUpdate(db: Database, columns: Set<String>) throws }
-
v0.76.0 Changes
๐ Released July 19, 2016
๐ฅ Breaking Change
The query interface
order
method now replaces any previously applied ordering (related issue: #85):// SELECT * FROM "persons" ORDER BY "name" Person.order(scoreColumn).order(nameColumn)
-
v0.75.2 Changes
๐ Released July 18, 2016
๐ Fixed
- ๐ Fixed crashes that could happen when using virtual tables (fixes #82)