Skip to content

Commit d732729

Browse files
committed
db: parenthesize subquery in CleanInactiveUsers
The "id NOT IN ?" placeholder expands the bun subquery without any surrounding parentheses, so the generated statement reads "id NOT IN SELECT ..." which SQLite rejects with a syntax error. As a result "pw admin gc" always fails while cleaning inactive users. Wrap the placeholder in parentheses so the subquery is valid. Signed-off-by: Robin Jarry <robin@jarry.cc>
1 parent e917f2c commit d732729

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎pkg/db/confirmation.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (q *Queries) CleanInactiveUsers() (int64, error) {
5555
res, err := q.Delete((*User)(nil)).
5656
Where("is_active = ?", false).
5757
Where(
58-
"id NOT IN ?",
58+
"id NOT IN (?)",
5959
q.Select((*EmailConfirmation)(nil)).
6060
Column("user_id").
6161
Where("user_id IS NOT NULL"),

0 commit comments

Comments
 (0)