DapperLib / DapperLib/Dapper

Add command flags to overloads

Open
#918 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have many scenarios where in order to optimize queries I generate a lot of dynamic SQL with no paramenters and use CommandFlags.NoCache. I also use some unbuffered results too.

Currently, you must replace

cnn.QueryAsync<x>(sql);

with

cnn.QueryAsync<x>(new CommandDefinition(sql, flags: CommandFlags.NoCache));

which adds some boilerplate to a simple query command.

I know it's just for convenience, but would it be possible to add CommandFlags as one of the default overload parameters to the existing commands?

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 locating the existing QueryAsync overloads and the CommandDefinition type used in the examples. Review how current overloads handle command execution, then confirm that callers can supply CommandFlags such as NoCache without constructing CommandDefinition while existing simple calls continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
api, database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.