Skip to content

Commit 6780467

Browse files
committed
multi: use fillPlaceHolders in CountActions
This commits ensures that the `CountActions` function in the `sqlc` & `sqlcmig6` packages utilizes the `fillPlaceHolders` function to properly handle SQL query placeholders. This ensures that the function works correctly on `Postgres` backends when it contains ? placeholders instead of positional ones (e.g., $1).
1 parent 0030412 commit 6780467

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

db/sqlc/actions_custom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (q *Queries) CountActions(ctx context.Context,
8585
arg ActionQueryParams) (int64, error) {
8686

8787
query, args := buildActionsQuery(arg, true)
88-
row := q.db.QueryRowContext(ctx, query, args...)
88+
row := q.db.QueryRowContext(ctx, fillPlaceHolders(query), args...)
8989

9090
var count int64
9191
err := row.Scan(&count)

db/sqlcmig6/actions_custom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (q *Queries) CountActions(ctx context.Context,
8585
arg ActionQueryParams) (int64, error) {
8686

8787
query, args := buildActionsQuery(arg, true)
88-
row := q.db.QueryRowContext(ctx, query, args...)
88+
row := q.db.QueryRowContext(ctx, fillPlaceHolders(query), args...)
8989

9090
var count int64
9191
err := row.Scan(&count)

0 commit comments

Comments
 (0)