Audit with AI

This commit is contained in:
2025-11-16 11:37:02 +05:30
parent 551e2123bc
commit 29cddb6389
24 changed files with 1286 additions and 79 deletions

View File

@@ -5,6 +5,7 @@ package pgm
import (
"context"
"errors"
"strconv"
"strings"
@@ -56,6 +57,9 @@ func (q *updateQry) Where(cond ...Conditioner) WhereOrExec {
}
func (q *updateQry) Exec(ctx context.Context) error {
if len(q.cols) == 0 {
return errors.New("update query has no columns to update: call Set() before Exec()")
}
_, err := poolPGX.Load().Exec(ctx, q.String(), q.args...)
if err != nil {
return err
@@ -65,6 +69,9 @@ func (q *updateQry) Exec(ctx context.Context) error {
}
func (q *updateQry) ExecTx(ctx context.Context, tx pgx.Tx) error {
if len(q.cols) == 0 {
return errors.New("update query has no columns to update: call Set() before ExecTx()")
}
_, err := tx.Exec(ctx, q.String(), q.args...)
if err != nil {
return err