Skip to content

Commit

Permalink
fix: Return id AS id
Browse files Browse the repository at this point in the history
  • Loading branch information
EnriqueL8 committed Feb 2, 2018
2 parents fb951c6 + 22868a1 commit 9433746
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftKueryPostgreSQL/PostgreSQLConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ public class PostgreSQLConnection: Connection {
let columns = insertQuery.table.columns.filter { $0.isPrimaryKey && $0.autoIncrement }

if (insertQuery.suffix == nil && columns.count == 1) {
let insertQueryReturnID = insertQuery.suffix("Returning " + columns[0].name)
let insertQueryReturnID = insertQuery.suffix("Returning " + columns[0].name + " AS id")
postgresQuery = try insertQueryReturnID.build(queryBuilder: queryBuilder)
}

Expand Down

0 comments on commit 9433746

Please sign in to comment.