Skip to content

Commit 3cc19b3

Browse files
Sqlite: double not mapped to REAL (#59)
* Add float and double value to test entity * Add missing SQLite mapping for doubles
1 parent 1429edc commit 3cc19b3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/PhenX.EntityFrameworkCore.BulkInsert.Sqlite/SqliteBulkInsertProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private static SqliteType GetSqliteType(ColumnMetadata column)
4949
return SqliteType.Integer;
5050
}
5151

52-
if (string.Equals(storeType, "FLOAT", StringComparison.OrdinalIgnoreCase))
52+
if (string.Equals(storeType, "FLOAT", StringComparison.OrdinalIgnoreCase) || string.Equals(storeType, "REAL", StringComparison.OrdinalIgnoreCase))
5353
{
5454
return SqliteType.Real;
5555
}

tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/DbContext/TestEntity.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ public class TestEntity : TestEntityBase
1919
[Column("some_price")]
2020
public decimal Price { get; set; }
2121

22+
[Column("some_float")]
23+
public float Float { get; set; } = 10.1f;
24+
25+
[Column("some_double")]
26+
public double Double { get; set; } = 10.1d;
27+
2228
[Column("the_identifier")]
2329
public Guid Identifier { get; set; }
2430

0 commit comments

Comments
 (0)