Skip to content

Commit 367f6aa

Browse files
committed
add(_ column:) => add(column:)
1 parent 194d99a commit 367f6aa

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Documentation/Index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ let newColumn = ColumnDefinition(
15331533
let schemaChanger = SchemaChanger(connection: db)
15341534

15351535
try schemaChanger.alter(table: "users") { table in
1536-
table.add(newColumn)
1536+
table.add(column: newColumn)
15371537
}
15381538
```
15391539

SQLite.playground/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ print(columns)
115115

116116
let schemaChanger = SchemaChanger(connection: db)
117117
try schemaChanger.alter(table: "users") { table in
118-
table.add(ColumnDefinition(name: "age", type: .INTEGER))
118+
table.add(column: ColumnDefinition(name: "age", type: .INTEGER))
119119
table.rename(column: "email", to: "electronic_mail")
120120
table.drop(column: "name")
121121
}

Sources/SQLite/Schema/SchemaChanger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class SchemaChanger: CustomStringConvertible {
9595
self.name = name
9696
}
9797

98-
public func add(_ column: ColumnDefinition) {
98+
public func add(column: ColumnDefinition) {
9999
operations.append(.addColumn(column))
100100
}
101101

Tests/SQLiteTests/Schema/SchemaChangerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class SchemaChangerTests: SQLiteTestCase {
9999
defaultValue: .stringLiteral("foo"))
100100

101101
try schemaChanger.alter(table: "users") { table in
102-
table.add(newColumn)
102+
table.add(column: newColumn)
103103
}
104104

105105
let columns = try schema.columnDefinitions(table: "users")
@@ -114,7 +114,7 @@ class SchemaChangerTests: SQLiteTestCase {
114114
type: .TEXT)
115115

116116
XCTAssertThrowsError(try schemaChanger.alter(table: "users") { table in
117-
table.add(newColumn)
117+
table.add(column: newColumn)
118118
}) { error in
119119
if case SchemaChanger.Error.invalidColumnDefinition(_) = error {
120120
XCTAssertEqual("Invalid column definition: can not add primary key column", error.localizedDescription)

0 commit comments

Comments
 (0)