DapperLib / DapperLib/DapperAOT

Don't report DAP037 on (other) array types

Open
#156 0 comments 0 reactions 0 assignees View on GitHub

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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.