summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFröhlich A <froehlich.alexander@protonmail.com>2021-04-29 14:11:05 +0200
committerGitHub <noreply@github.com>2021-04-29 14:11:05 +0200
commit5439cfc317cd678438bd6c154b84c2bf625504ec (patch)
treec6b10d16a43e36b0bae5d5e69163728aa4298f56
parent198b5e3a7a629ea58b1e2a71a3e70f35484f289b (diff)
downloadNim-5439cfc317cd678438bd6c154b84c2bf625504ec.tar.gz
Fix `insert` calling wrong function (#17856)
The `insert` method is calling `tryInsertID`, which ignores the `pkName` parameter.
Calling `tryInsert` instead should be correct.
-rw-r--r--lib/impure/db_postgres.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim
index 034a94852..cb9e5414a 100644
--- a/lib/impure/db_postgres.nim
+++ b/lib/impure/db_postgres.nim
@@ -524,7 +524,7 @@ proc insert*(db: DbConn, query: SqlQuery, pkName: string,
             {.tags: [WriteDbEffect], since: (1, 3).} =
   ## executes the query (typically "INSERT") and returns the
   ## generated ID
-  result = tryInsertID(db, query, args)
+  result = tryInsert(db, query, pkName, args)
   if result < 0: dbError(db)
 
 proc execAffectedRows*(db: DbConn, query: SqlQuery,