DapperLib / DapperLib/DapperAOT
Don't report DAP037 on (other) array types
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 472
- Forks
- 43
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 18
Description
#125 added result type support for byte[] & sbyte[] to handle BLOBs.
Some databases support columns to be arrays of different types. E.g. PostgreSQL or Clickhouse.
Npgsql maps array types to Array (of element type).
Dapper vanilla supports arrays (of other types) as a result type, while DapperAOT reports DAP037.
For example (PostgreSQL):
create table arrays_table
(
id int4 not null unique,
strings text[],
ints int4[]
);
insert into arrays_table (id, strings, ints) values
(1, array['a', 'b', 'c'], array[1, 2, 3]),
(2, array['d', 'e', 'f'], array[4, 5, 6]),
(3, array['g', 'h', 'i'], array[7, 8, 9]);
With Dapper vanilla an array column can be selected as
IEnumerable<string[]> result = await conn.Query<string[]>("select strings from arrays_table")
or string[]? strings = conn.QuerySingleOrDefault<string[]>("select strings from arrays_table where id = 1"),
but with DapperAOT these fail to compile.
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 by tracing the DAP037 diagnostic and the result-type handling described in issue #125. Reproduce the reported array queries with the PostgreSQL examples in this issue, then verify that array result types other than byte[] and sbyte[] no longer produce DAP037 while existing diagnostics remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, postgresql
- Domain
- databases, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100