DapperLib / DapperLib/Dapper

WHERE IN issue for ODBC in 1.50.2

Open
#619 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

I've query like this:

Connection.Query<Table1>("SELECT Col1, Col2 FROM Table1 WHERE Col1 = ?col1? AND Col2 IN ?col2?",  new {col1 = 1, col2 = new[] {2, 3}})

As result I have SQL:

SELECT Col1, Col2 FROM Table1 WHERE Col1 = ? AND Col2 IN (?,?)

But I have only one parameter in DB command col1=1, instead of three,

When I run query with parameter that has only list, i.e.

Connection.Query<Table1>("SELECT Col1, Col2 FROM Table1 WHERE Col2 IN ?col2?",  new {col2 = new[] {2, 3}})

Everything is correct, I've two parameters in DB command.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two C# Connection.Query examples against ODBC and compare the command's parameter collection with the generated SQL. Trace the parameter-expansion path used for the combined scalar and list parameters. Done means the combined query supplies all three parameters and a regression test covers both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.