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
commit 5439cfc317
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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,