From 06116a54278b67523b69dd37525fba4317f79d78 Mon Sep 17 00:00:00 2001 From: Pythonic-Rainbow Date: Tue, 15 Feb 2022 02:03:31 +0000 Subject: [PATCH 1/3] Add support for ulong --- src/SQLite.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SQLite.cs b/src/SQLite.cs index ee172b39..0aea7f75 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -3319,6 +3319,9 @@ object ReadCol (Sqlite3Statement stmt, int index, SQLite3.ColType type, Type clr else if (clrType == typeof (Int64)) { return SQLite3.ColumnInt64 (stmt, index); } + else if (clrType == typeof (UInt64)) { + return (ulong)SQLite3.ColumnInt64 (stmt, index); + } else if (clrType == typeof (UInt32)) { return (uint)SQLite3.ColumnInt64 (stmt, index); } From ee88d8058f22a2bd463e0882756d6210b49da827 Mon Sep 17 00:00:00 2001 From: Pythonic-Rainbow Date: Tue, 15 Feb 2022 02:20:48 +0000 Subject: [PATCH 2/3] ulong for other stuff to parse --- src/SQLite.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index 0aea7f75..5050f432 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -2786,7 +2786,7 @@ public static string SqlDecl (TableMapping.Column p, bool storeDateTimeAsTicks, public static string SqlType (TableMapping.Column p, bool storeDateTimeAsTicks, bool storeTimeSpanAsTicks) { var clrType = p.ColumnType; - if (clrType == typeof (Boolean) || clrType == typeof (Byte) || clrType == typeof (UInt16) || clrType == typeof (SByte) || clrType == typeof (Int16) || clrType == typeof (Int32) || clrType == typeof (UInt32) || clrType == typeof (Int64)) { + if (clrType == typeof (Boolean) || clrType == typeof (Byte) || clrType == typeof (UInt16) || clrType == typeof (SByte) || clrType == typeof (Int16) || clrType == typeof (Int32) || clrType == typeof (UInt32) || clrType == typeof (Int64) || clrType == typeof (UInt64) { return "integer"; } else if (clrType == typeof (Single) || clrType == typeof (Double) || clrType == typeof (Decimal)) { @@ -3185,7 +3185,7 @@ internal static void BindParameter (Sqlite3Statement stmt, int index, object val else if (value is Boolean) { SQLite3.BindInt (stmt, index, (bool)value ? 1 : 0); } - else if (value is UInt32 || value is Int64) { + else if (value is UInt32 || value is Int64 || value is UInt64) { SQLite3.BindInt64 (stmt, index, Convert.ToInt64 (value)); } else if (value is Single || value is Double || value is Decimal) { @@ -3466,6 +3466,12 @@ internal static Action GetFastSetter (SQLiteCo return SQLite3.ColumnInt64 (stmt, index); }); } + else if (clrType == typeof(UInt64)) + { + fastSetter = CreateNullableTypedSetterDelegate(column, (stmt, index) => { + return (ulong)SQLite3.ColumnInt64(stmt, index); + }); + } else if (clrType == typeof (UInt32)) { fastSetter = CreateNullableTypedSetterDelegate (column, (stmt, index) => { return (uint)SQLite3.ColumnInt64 (stmt, index); From d9b8795f1f1bbcf97bd804c691fa7f711ad65a61 Mon Sep 17 00:00:00 2001 From: Pythonic-Rainbow Date: Tue, 15 Feb 2022 02:23:32 +0000 Subject: [PATCH 3/3] Fix missing ) .... omg --- src/SQLite.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index 5050f432..43ec6174 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -2786,7 +2786,7 @@ public static string SqlDecl (TableMapping.Column p, bool storeDateTimeAsTicks, public static string SqlType (TableMapping.Column p, bool storeDateTimeAsTicks, bool storeTimeSpanAsTicks) { var clrType = p.ColumnType; - if (clrType == typeof (Boolean) || clrType == typeof (Byte) || clrType == typeof (UInt16) || clrType == typeof (SByte) || clrType == typeof (Int16) || clrType == typeof (Int32) || clrType == typeof (UInt32) || clrType == typeof (Int64) || clrType == typeof (UInt64) { + if (clrType == typeof (Boolean) || clrType == typeof (Byte) || clrType == typeof (UInt16) || clrType == typeof (SByte) || clrType == typeof (Int16) || clrType == typeof (Int32) || clrType == typeof (UInt32) || clrType == typeof (Int64) || clrType == typeof (UInt64)) { return "integer"; } else if (clrType == typeof (Single) || clrType == typeof (Double) || clrType == typeof (Decimal)) {