Skip to content

Commit f6a1243

Browse files
pimpinclaude
andcommitted
fix(spec): update IN array test to reflect single-param binding
bind() passes the whole array as one positional parameter ($2), not one param per element. This is correct: "name IN $2" with $2 = ["Alice","Bob"] is valid N1QL and produces a single prepared-statement shape regardless of array length, which is the caching goal of this PR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5093252 commit f6a1243

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

spec/relation_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ def self.active
355355
it "should parameterize array IN conditions" do
356356
relation = RelationModel.where(name: ["Alice", "Bob"])
357357
n1ql, params = relation.send(:to_n1ql_with_params)
358-
expect(n1ql).to include("name IN [$2, $3]")
359-
expect(params).to eq(["relation_model", "Alice", "Bob"])
358+
expect(n1ql).to include("name IN $2")
359+
expect(params).to eq(["relation_model", ["Alice", "Bob"]])
360360
end
361361
end
362362

0 commit comments

Comments
 (0)