From 033ad1877964b325695fda74ea7f811ef6d466da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Aug 2016 13:51:34 +0200 Subject: [PATCH 1/7] CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15a50c726..ef81ce635 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ Released August 6, 2016 - 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,7 +30,7 @@ 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 } } ``` From a7d2c1137ccc168620a2431fc2a0e4aa9adf7f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Aug 2016 13:53:25 +0200 Subject: [PATCH 2/7] CHANGELOG.md --- CHANGELOG.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef81ce635..1785403f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,6 @@ 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 @@ -35,6 +29,12 @@ Released August 6, 2016 } ``` +- Row adopts DictionaryLiteralConvertible: + + ```swift + let row: Row = ["name": "foo", "date": NSDate()] + ``` + **Breaking Changes** From 7d6fcda03e44fe59402fa6eba04103f1ed8869ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Aug 2016 15:26:18 +0200 Subject: [PATCH 3/7] slow_methods.sh output methods that are slow to compile --- slow_methods.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 slow_methods.sh 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 From 76ab3fd1ab1ebf5360a32cdc5e3ef99f78cf613c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Aug 2016 15:26:30 +0200 Subject: [PATCH 4/7] Better compilation time --- GRDB/Core/Statement.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift index 8bd5233ba..26984e492 100644 --- a/GRDB/Core/Statement.swift +++ b/GRDB/Core/Statement.swift @@ -217,7 +217,7 @@ public final class SelectStatement : Statement { /// The column names, ordered from left to right. public lazy var columnNames: [String] = { let sqliteStatement = self.sqliteStatement - return (0.. String in String.fromCString(sqlite3_column_name(sqliteStatement, Int32(index)))! } }() /// Cache for indexOfColumn(). Keys are lowercase. From ced94930690603ede9d421c03536b87ee2a54c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Aug 2016 15:26:39 +0200 Subject: [PATCH 5/7] Better compilation time --- GRDB/Core/Row.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GRDB/Core/Row.swift b/GRDB/Core/Row.swift index 68d2b2fa2..a42552167 100644 --- a/GRDB/Core/Row.swift +++ b/GRDB/Core/Row.swift @@ -873,7 +873,7 @@ private struct StatementCopyRowImpl : RowImpl { init(sqliteStatement: SQLiteStatement, columnNames: [String]) { assert(sqliteStatement != nil) let sqliteStatement = sqliteStatement - self.databaseValues = ContiguousArray((0.. Date: Mon, 8 Aug 2016 08:06:09 +0200 Subject: [PATCH 6/7] Documentation --- README.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 42ef8dadf..7a1c96244 100644 --- a/README.md +++ b/README.md @@ -2315,19 +2315,9 @@ let idColumn = SQLColumn("id") let nameColumn = SQLColumn("name") ``` -You can now derive requests with the following methods: +You can now build requests with the following methods: `all`, `select`, `distinct`, `filter`, `group`, `having`, `order`, `reverse`, `limit`. -- `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. +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. From 8c43047c95a565542804c0d1377e7327fd5c9c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 8 Aug 2016 08:06:43 +0200 Subject: [PATCH 7/7] Documentation --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 7a1c96244..13507ba0f 100644 --- a/README.md +++ b/README.md @@ -2315,9 +2315,7 @@ let idColumn = SQLColumn("id") let nameColumn = SQLColumn("name") ``` -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(...)`. +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.