DapperLib / DapperLib/DapperAOT

Npgsql parameter rewrite

Open
#78 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
472
Forks
43
Avg merge
1d 4h
Merged PRs (30d)
18

Description

There are two parameter models in Npgsql - ordinal and nominal; we use nominal, but the ordinal API is much more efficient; we could ingest nominal const sql and rewrite it as ordinal

this should include splitting semi-colon multi-statements into DbBatch when possible

tasks:

  • basic generalized SQL parser
  • SQL syntax tests for postgresql peculiarities
  • basic exploration of batch concept
  • "real" batch concept (UnifiedBatch, should work with/without DbBatch API)
  • codegen (including turn-off-and-onable)
  • benchmark:
    • vanilla Dapper, parameterized single batch (Npgsql param rewrite)
    • vanilla Dapper, parameterized multi-batch (Npgsql param rewrite+split)
    • AOT Dapper, rewrite enabled, parameterized single batch, DbBatch disabled
    • AOT Dapper, rewrite enabled, parameterized multi batch, DbBatch disabled
    • AOT Dapper, rewrite enabled, parameterized single batch, DbBatch enabled
    • AOT Dapper, rewrite enabled, parameterized multi batch, DbBatch enabled
  • use parser in place of the regex in the regular code path? as an option with fallback?
  • docs
  • performance tuning of parser (I have a plan, don't ask; kind of a rewrite of the parser) (note this is not critical path)

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 reviewing the completed generalized SQL parser and UnifiedBatch work described in the issue, then inspect the remaining codegen, benchmark, parser integration, performance, and documentation tasks. Done means the selected remaining scope is implemented and its relevant benchmark or test coverage demonstrates nominal parameters can be rewritten to ordinal parameters, with multi-statements split into DbBatch when supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, postgresql, sql
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.