Repository navigation
Labels
area-adonet-sqlitecommunity-contributioncustomer-reportedgood first issueThis issue should be relatively straightforward to fix.
Milestone
Description
Microsoft.Data.Sqlite 6.0.1
TargetFramework net6.0-windows
当我创建一个字符串类型的SqliteParameter时,我查询它的类型,得到的类型信息是 “SqliteType.Integer”
var p = new Microsoft.Data.Sqlite.SqliteParameter("Name","123");后来我在源码中定位到了以下位置,这就有点不合适了吧
efcore/src/Microsoft.Data.Sqlite.Core/SqliteValueBinder.cs
Lines 240 to 263 in 8144d50
| private static readonly Dictionary<Type, SqliteType> _sqliteTypeMapping = | |
| new() | |
| { | |
| { typeof(bool), SqliteType.Integer }, | |
| { typeof(byte), SqliteType.Integer }, | |
| { typeof(byte[]), SqliteType.Blob }, | |
| { typeof(char), SqliteType.Text }, | |
| { typeof(DateTime), SqliteType.Text }, | |
| { typeof(DateTimeOffset), SqliteType.Text }, | |
| { typeof(DBNull), SqliteType.Text }, | |
| { typeof(decimal), SqliteType.Text }, | |
| { typeof(double), SqliteType.Real }, | |
| { typeof(float), SqliteType.Real }, | |
| { typeof(Guid), SqliteType.Text }, | |
| { typeof(int), SqliteType.Integer }, | |
| { typeof(long), SqliteType.Integer }, | |
| { typeof(sbyte), SqliteType.Integer }, | |
| { typeof(short), SqliteType.Integer }, | |
| { typeof(string), SqliteType.Integer }, | |
| { typeof(TimeSpan), SqliteType.Text }, | |
| { typeof(uint), SqliteType.Integer }, | |
| { typeof(ulong), SqliteType.Integer }, | |
| { typeof(ushort), SqliteType.Integer } | |
| }; |
Metadata
Metadata
Assignees
Labels
area-adonet-sqlitecommunity-contributioncustomer-reportedgood first issueThis issue should be relatively straightforward to fix.
Activity
roji commentedon Jan 19, 2022
Google Translate:
/cc @bricelam
[-]string 类型参数 获取到的SqliteType是Integer[/-][+]Correct SqliteType inference from string, DateOnly, TimeOnly[/+]