Skip to content

Commit

Permalink
Merge pull request #32 from noppoMan/typo
Browse files Browse the repository at this point in the history
typo
  • Loading branch information
noppoMan committed Feb 4, 2017
2 parents 235979c + 9a1710b commit 333b544
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Sources/SwiftKnex/Knex+Transaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

extension Knex {

public func transaciton(_ callback: (Connection) throws -> Void) throws {
public func transaction(_ callback: (Connection) throws -> Void) throws {
try self.connection.transaction { trx in
try callback(trx)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftKnex/Migration/Migrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class MigrateRunner {
}

func up() throws {
try con.knex().transaciton { trx in
try con.knex().transaction { trx in
var recentMigrated = [String]()
let migrationsPeformed = try fetchMigrations(trx: trx)

Expand Down Expand Up @@ -153,7 +153,7 @@ class MigrateRunner {
}

func down() throws {
try con.knex().transaciton { trx in
try con.knex().transaction { trx in
let migrationsPeformed = try fetchMigrations(trx: trx)
if migrationsPeformed.isEmpty {
print("Already up to date")
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftKnexTests/DDLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DDLTests: XCTestCase {
}

func dropTable(){
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
do {
_ = try con.knex().execRaw(trx: trx, sql: Drop(table: "test_users").toDDL())
} catch {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftKnexTests/InsertTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class InsertTests: XCTestCase {
override func setUp() {
con = try! KnexConnection(config: basicKnexConfig())
dropTable()
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
_ = try! con.knex().execRaw(trx: trx, sql: testUserSchema().toDDL())
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftKnexTests/JSONDataTypeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class JSONDataTypeTests: XCTestCase {
Schema.Field(name: "body", type: Schema.Types.JSON())
])

try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
_ = try! con.knex().execRaw(trx: trx, sql: jsonTable.toDDL())
let json: [String: Any] = [
"name": "Luke",
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftKnexTests/JoinTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class JoinTests: XCTestCase {
override func setUp() {
con = try! KnexConnection(config: basicKnexConfig())
dropTable()
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
_ = try! con.knex().execRaw(trx: trx, sql: testUserSchema().toDDL())
_ = try! con.knex().insert(into: "test_users", collection: testUserCollection(), trx: trx)

Expand All @@ -38,7 +38,7 @@ class JoinTests: XCTestCase {
}

func dropTable(){
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
do {
_ = try con.knex().execRaw(trx: trx, sql: Drop(table: "test_users").toDDL())
} catch {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftKnexTests/SelectTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SelectTests: XCTestCase {
override func setUp() {
con = try! KnexConnection(config: basicKnexConfig())
dropTable()
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
_ = try! con.knex().execRaw(trx: trx, sql: testUserSchema().toDDL())
_ = try! con.knex().insert(into: "test_users", collection: testUserCollection(), trx: trx)
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/SwiftKnexTests/TransactionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TransactionTests: XCTestCase {
override func setUp() {
con = try! KnexConnection(config: basicKnexConfig())
dropTable()
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
_ = try! con.knex().execRaw(trx: trx, sql: testUserSchema().toDDL())
}
}
Expand All @@ -43,7 +43,7 @@ class TransactionTests: XCTestCase {
}

func testTransactionCommit(){
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
XCTAssertEqual(con.knex().connection.availableConnection, 3)
_ = try con.knex().insert(into: "test_users", collection: testUserCollection(), trx: trx)
_ = try con.knex().table("test_users").where("id" == 1).update(sets: ["age": 10], trx: trx)
Expand All @@ -59,7 +59,7 @@ class TransactionTests: XCTestCase {

func testTransactionRollback() {
do {
try con.knex().transaciton { trx in
try con.knex().transaction { trx in
XCTAssertEqual(con.knex().connection.availableConnection, 3)
_ = try con.knex().insert(into: "test_users", collection: testUserCollection(), trx: trx)
_ = try con.knex().table("test_users").where("id" == 1).update(sets: ["age": 10], trx: trx)
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftKnexTests/UpdateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class UpdateTests: XCTestCase {
override func setUp() {
con = try! KnexConnection(config: basicKnexConfig())
dropTable()
try! con.knex().transaciton { trx in
try! con.knex().transaction { trx in
_ = try! con.knex().execRaw(trx: trx, sql: testUserSchema().toDDL())
_ = try! con.knex().insert(into: "test_users", collection: testUserCollection(), trx: trx)
}
Expand Down

0 comments on commit 333b544

Please sign in to comment.