DapperLib / DapperLib/Dapper.Contrib
Does not work with OleDbConnection
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
Good morning everyone.
I figured out that Dapper.Contrib does not support OleDbConnection, that because, for example on the Get function of SqlMapperExtensions.cs do:
var type = typeof(T);
if (!GetQueries.TryGetValue(type.TypeHandle, out string sql))
{
var key = GetSingleKey<T>(nameof(Get));
var name = GetTableName(type);
sql = $"select * from {name} where {key.Name} = @id";
GetQueries[type.TypeHandle] = sql;
}
var dynParams = new DynamicParameters();
dynParams.Add("@id", id);
the "@" notation is not supported on OleDb, for my example I need to operate bot SQL Server and MS Access DB and OleDBConnection is the only way to accomplished both connection
There is a plan to support OleDbConnection "?" notation?
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 in SqlMapperExtensions.cs at the Get function and trace how SQL and DynamicParameters are constructed. Examine how the @id parameter is handled for SQL Server and what must differ for OleDbConnection's ? notation. Done means the reported SQL Server and MS Access/OleDbConnection use cases are supported without regressing existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100