Skip to content

Commit f02b75a

Browse files
committed
Mark create(table:) @NoEscape
This removes the `self.` requirement from the block, which should lead to better legibility in some cases. Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent 628a289 commit f02b75a

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

SQLite Tests/SchemaTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class SchemaTests: SQLiteTestCase {
9292
}
9393

9494
func test_createTable_intColumn_referencingNamespacedColumn_buildsReferencesClause() {
95-
let users = self.users
9695
db.create(table: users) { t in
9796
t.column(id, primaryKey: true)
9897
t.column(manager_id, references: users[id])
@@ -104,7 +103,6 @@ class SchemaTests: SQLiteTestCase {
104103
}
105104

106105
func test_createTable_intColumn_referencingQuery_buildsReferencesClause() {
107-
let users = self.users
108106
db.create(table: users) { t in
109107
t.column(id, primaryKey: true)
110108
t.column(manager_id, references: users)
@@ -165,7 +163,6 @@ class SchemaTests: SQLiteTestCase {
165163
}
166164

167165
func test_createTable_foreignKey_referencingNamespacedColumn_buildsForeignKeyTableConstraint() {
168-
let users = self.users
169166
db.create(table: users) { t in
170167
t.column(id, primaryKey: true)
171168
t.column(manager_id)
@@ -179,7 +176,6 @@ class SchemaTests: SQLiteTestCase {
179176
}
180177

181178
func test_createTable_foreignKey_withUpdateDependency_buildsUpdateDependency() {
182-
let users = self.users
183179
db.create(table: users) { t in
184180
t.column(id, primaryKey: true)
185181
t.column(manager_id)
@@ -193,7 +189,6 @@ class SchemaTests: SQLiteTestCase {
193189
}
194190

195191
func test_create_foreignKey_withDeleteDependency_buildsDeleteDependency() {
196-
let users = self.users
197192
db.create(table: users) { t in
198193
t.column(id, primaryKey: true)
199194
t.column(manager_id)
@@ -207,7 +202,6 @@ class SchemaTests: SQLiteTestCase {
207202
}
208203

209204
func test_createTable_foreignKey_withCompositeKey_buildsForeignKeyTableConstraint() {
210-
let users = self.users
211205
let manager_id = Expression<Int64>("manager_id") // required
212206

213207
db.create(table: users) { t in

SQLite/Schema.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public extension Database {
2828
#table: Query,
2929
temporary: Bool = false,
3030
ifNotExists: Bool = false,
31-
_ block: SchemaBuilder -> ()
31+
@noescape _ block: SchemaBuilder -> ()
3232
) -> Statement {
3333
var builder = SchemaBuilder(table)
3434
block(builder)

0 commit comments

Comments
 (0)