PackListParameters should check `IEnumerable<DbString>` before FeatureSupport.Arrays
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
Dapper: 1.50.7
https://github.com/StackExchange/Dapper/blob/1.50.7/Dapper/SqlMapper.cs#L1975
Dapper.DbString[] should not be directly send to PostgreSQL or other server in the case at least.
Edited: In fact, it's no needed to use IEnumerable<DbString> in PostgreSQL, just hit this during migrate between databases.
BTW: Seems there is another limit for PostgreSQL, only IList or T[] is supported for npgsql >= 3.0, and not for IEnumerable/IList. But can be easily workaround by user code.
System.NotSupportedException: 'Npgsql 3.x removed support for writing a parameter with an IEnumerable value, use .ToList()/.ToArray() instead'
https://github.com/npgsql/npgsql/blob/v4.0.4.1/src/Npgsql/TypeMapping/ConnectorTypeMapper.cs#L155
https://github.com/npgsql/npgsql/blob/v4.0.4.1/src/Npgsql/TypeMapping/ConnectorTypeMapper.cs#L117
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Dapper/SqlMapper.cs around line 1975 and read PackListParameters alongside the linked PostgreSQL and Npgsql behavior. Verify the parameter handling for DbString arrays or enumerables across the relevant database cases, then confirm the resulting behavior against the reported Npgsql limitations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100