diff --git a/CHANGELOG.md b/CHANGELOG.md index 15a50c726..1785403f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,16 +9,10 @@ Released August 6, 2016 - Upgrade sqlcipher to v3.4.0 ([announcement](https://discuss.zetetic.net/t/sqlcipher-3-4-0-release/1273), [changelog](https://github.com/sqlcipher/sqlcipher/blob/master/CHANGELOG.md)) -- Row adopts DictionaryLiteralConvertible: - - ```swift - let row: Row = ["name": "foo", "date": NSDate()] - ``` - - DSL for table creation and updates (closes [#83](https://github.com/groue/GRDB.swift/issues/83), [documentation](https://github.com/groue/GRDB.swift#database-schema)): ```swift - db.create(table: "pointOfInterests") { t in + try db.create(table: "pointOfInterests") { t in t.column("id", .Integer).primaryKey() t.column("title", .Text) t.column("favorite", .Boolean).notNull() @@ -30,11 +24,17 @@ Released August 6, 2016 - Support for the `length` SQLite built-in function: ```swift - db.create(table: "persons") { t in + try db.create(table: "persons") { t in t.column("name", .Text).check { length($0) > 0 } } ``` +- Row adopts DictionaryLiteralConvertible: + + ```swift + let row: Row = ["name": "foo", "date": NSDate()] + ``` + **Breaking Changes** diff --git a/GRDB/Core/Row.swift b/GRDB/Core/Row.swift index cc0e515c2..d66087f37 100644 --- a/GRDB/Core/Row.swift +++ b/GRDB/Core/Row.swift @@ -848,7 +848,7 @@ private struct StatementCopyRowImpl : RowImpl { init(sqliteStatement: SQLiteStatement, columnNames: [String]) { let sqliteStatement = sqliteStatement - self.databaseValues = ContiguousArray((0.. String in String(cString: sqlite3_column_name(sqliteStatement, Int32(index))) } }() /// Cache for indexOfColumn(). Keys are lowercase. diff --git a/README.md b/README.md index d07e36c5e..ee3a59b89 100644 --- a/README.md +++ b/README.md @@ -2276,19 +2276,7 @@ let idColumn = Column("id") let nameColumn = Column("name") ``` -You can now derive requests with the following methods: - -- `all` -- `select` -- `distinct` -- `filter` -- `group` -- `having` -- `order` -- `reverse` -- `limit` - -All the methods above return another request, which you can further refine by applying another derivation method. +You can now build requests with the following methods: `all`, `select`, `distinct`, `filter`, `group`, `having`, `order`, `reverse`, `limit`. All those methods return another request, which you can further refine by applying another method: `Person.select(...).filter(...).order(...)`. - `all()`: the request for all rows. diff --git a/slow_methods.sh b/slow_methods.sh new file mode 100755 index 000000000..ca4921985 --- /dev/null +++ b/slow_methods.sh @@ -0,0 +1,10 @@ +#/bin/sh +# +# Outputs the compilation time of all methods. +# To get the 20 slowest methods, run ./slow_methods.sh | head -20 +set -e + +PROJECT=GRDB.xcodeproj +TARGET=GRDBiOS + +OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' xcodebuild -project $PROJECT -target $TARGET 2>&1 clean build | grep '^[0-9][0-9.]*.*\t' | sort -nr