-
Jamie Tanna authoredJamie Tanna authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
queries.sql.go 824 B
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.23.0
// source: queries.sql
package db
import (
"context"
)
const anonymiseAll = `-- name: AnonymiseAll :exec
update sensitive_packages
set
package_pattern = 'ANON-' || hex(sha3(package_pattern))
where
package_pattern NOT LIKE 'ANON-%'
`
// Because all of the sensitive_packages table defines things that are sensitive, we perform a blanket anonymisation
func (q *Queries) AnonymiseAll(ctx context.Context) error {
_, err := q.db.ExecContext(ctx, anonymiseAll)
return err
}
const countEntries = `-- name: CountEntries :one
select count(*) from sensitive_packages
`
func (q *Queries) CountEntries(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, countEntries)
var count int64
err := row.Scan(&count)
return count, err
}