Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo #32

Merged
merged 1 commit into from
Feb 4, 2017
Merged

typo #32

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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