tenseleyflow/shithub / 387246f

Browse files

repos/queries: name oids param on GetCommitVerificationsForOIDs

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
387246fad8142eb69fb5002e5d4d77dd96bbde7e
Parents
b331ee9
Tree
679af79

2 changed files

StatusFile+-
M internal/repos/queries/commit_verification_cache.sql 1 1
M internal/repos/sqlc/commit_verification_cache.sql.go 3 3
internal/repos/queries/commit_verification_cache.sqlmodified
@@ -44,7 +44,7 @@ SELECT repo_id, commit_oid, reason, verified,
4444
        signer_user_id, signer_subkey_id, kind,
4545
        signature_armored, payload, verified_at, invalidated_at
4646
 FROM commit_verification_cache
47
-WHERE repo_id = $1 AND commit_oid = ANY($2::text[]);
47
+WHERE repo_id = sqlc.arg(repo_id) AND commit_oid = ANY(sqlc.arg(oids)::text[]);
4848
 
4949
 -- name: InvalidateVerificationsForSubkey :exec
5050
 -- Stamps invalidated_at on every cache row whose signer_subkey_id
internal/repos/sqlc/commit_verification_cache.sql.gomodified
@@ -72,15 +72,15 @@ WHERE repo_id = $1 AND commit_oid = ANY($2::text[])
7272
 `
7373
 
7474
 type GetCommitVerificationsForOIDsParams struct {
75
-	RepoID  int64
76
-	Column2 []string
75
+	RepoID int64
76
+	Oids   []string
7777
 }
7878
 
7979
 // Batch read for the commit-list page. Takes an array of OIDs and
8080
 // returns existing rows; missing OIDs are absent from the result and
8181
 // the renderer treats them as "not yet verified".
8282
 func (q *Queries) GetCommitVerificationsForOIDs(ctx context.Context, db DBTX, arg GetCommitVerificationsForOIDsParams) ([]CommitVerificationCache, error) {
83
-	rows, err := db.Query(ctx, getCommitVerificationsForOIDs, arg.RepoID, arg.Column2)
83
+	rows, err := db.Query(ctx, getCommitVerificationsForOIDs, arg.RepoID, arg.Oids)
8484
 	if err != nil {
8585
 		return nil, err
8686
 	}