Skip to content

Commit 3def7d6

Browse files
committed
Make name public, expose plain SQL run
1 parent 08bed02 commit 3def7d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SQLite/Schema/SchemaChanger.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public class SchemaChanger: CustomStringConvertible {
100100
public class AlterTableDefinition {
101101
fileprivate var operations: [Operation] = []
102102

103-
let name: String
103+
public let name: String
104104

105105
init(name: String) {
106106
self.name = name
@@ -223,6 +223,11 @@ public class SchemaChanger: CustomStringConvertible {
223223
try connection.run("ALTER TABLE \(table.quote()) RENAME TO \(to.quote())")
224224
}
225225

226+
// Runs arbitrary SQL. Should only be used if no predefined operations exist.
227+
public func run(sql: String) throws {
228+
try connection.run(sql)
229+
}
230+
226231
private func run(table: String, operation: Operation) throws {
227232
try operation.validate()
228233

0 commit comments

Comments
 (0)