-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite TypeHandler not called #2074
Comments
karenpayneoregon
changed the title
SQLite TypeHandler called
SQLite TypeHandler not called
Apr 21, 2024
Well that seems odd, especially for the write path (the read path is
trickier because of the weak type model in sqlite) - however 2.1.44 is
hidden currently precisely because of a reported problem around Date only -
is it possibly related? Does it fail in 2.1.35?
…On Sun, 21 Apr 2024, 19:09 Karen Payne, ***@***.***> wrote:
Used the following handler with SQL-Server, works as expected.
public class DateOnlyTypeHandler : SqlMapper.TypeHandler<DateOnly>{
public override void SetValue(IDbDataParameter parameter, DateOnly date)
{
parameter.Value = date.ToString("yyyy-MM-dd");
}
public override DateOnly Parse(object value)
=> DateOnly.FromDateTime((DateTime)value);}
*Setup*
internal class DapperOperation{
private readonly IDbConnection _cn;
public DapperOperation()
{
_cn = new SqlConnection(ConnectionString());
SqlMapper.AddTypeHandler(new SqlDateOnlyTypeHandler());
}
------------------------------
*Problem*
Tried this with SQLite.Core with SQLiteConnection and neither SetValue
nor Parse are executed which I learned by a) inspecting values sent to
the database b) setting breakpoints.
- Dapper 2.1.44
- System.Data.SQLite.Core 1.0.118
- VS2022 17.9.2
- NET8
—
Reply to this email directly, view it on GitHub
<#2074> or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEHMD7K6LDIINMZTOAHJTY6P6G3BFKMF2HI4TJMJ2XIZLTSOBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJLJONZXKZNENZQW2ZNLORUHEZLBMRPXI6LQMWBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTLDTOVRGUZLDORPXI6LQMWSUS43TOVS2M5DPOBUWG44SQKSHI6LQMWVHEZLQN5ZWS5DPOJ42K5TBNR2WLJZRGYYTGMZUGWBKI5DZOBS2K2LTON2WLJLWMFWHKZNKGIZDKNJRHE4TINRWU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you are subscribed to this thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
|
No it does not fail with 2.1.35, works as expected. |
K, adding to my bucket of #fail for this morning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used the following handler with SQL-Server, works as expected.
Setup
Problem
Tried this with
SQLite.Core
withSQLiteConnection
and neitherSetValue
norParse
are executed which I learned by a) inspecting values sent to the database b) setting breakpoints.The text was updated successfully, but these errors were encountered: