Fix insert calling wrong function (#17856)

The `insert` method is calling `tryInsertID`, which ignores the `pkName` parameter.
Calling `tryInsert` instead should be correct.
This commit is contained in:
Fröhlich A
2021-04-29 14:11:05 +02:00
committed by GitHub
parent 198b5e3a7a
commit 5439cfc317

View File

@@ -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,