Skip to content

Commit

Permalink
Fix a small issue with query in.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Feb 18, 2021
1 parent 7e858c0 commit 96dc2f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/exprs/sqlite/SQLiteIn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ extension InExpr: SQLiteExpr where T: SQLiteExpr, T.ResultType: SQLiteValue {
if count > 0 {
parameterCount += 1
query.append("?\(parameterCount)")
}
for _ in 1..<count {
parameterCount += 1
query.append(", ?\(parameterCount)")
if count > 1 {
for _ in 1..<count {
parameterCount += 1
query.append(", ?\(parameterCount)")
}
}
}
query.append(")")
}
Expand Down
10 changes: 6 additions & 4 deletions src/exprs/sqlite/SQLiteNotIn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ extension NotInExpr: SQLiteExpr where T: SQLiteExpr, T.ResultType: SQLiteValue {
if count > 0 {
parameterCount += 1
query.append("?\(parameterCount)")
}
for _ in 1..<count {
parameterCount += 1
query.append(", ?\(parameterCount)")
if count > 1 {
for _ in 1..<count {
parameterCount += 1
query.append(", ?\(parameterCount)")
}
}
}
query.append(")")
}
Expand Down

0 comments on commit 96dc2f6

Please sign in to comment.