From 16759b9598980e3f8184b3041bc0938aa67d85ce Mon Sep 17 00:00:00 2001 From: Thomas Stocker Date: Mon, 6 Sep 2021 02:06:26 +0200 Subject: [PATCH 01/17] AOT Jit Compile Workaround --- src/SQLite.cs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index ee172b39..a4dca86e 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -25,6 +25,7 @@ using System; using System.Collections; +using System.Collections.Concurrent; using System.Diagnostics; #if !USE_SQLITEPCL_RAW using System.Runtime.InteropServices; @@ -35,6 +36,7 @@ using System.Linq.Expressions; using System.Text; using System.Threading; +using ExecutionEngineException = System.ExecutionEngineException; #if USE_CSHARP_SQLITE using Sqlite3 = Community.CsharpSqlite.Sqlite3; @@ -2139,6 +2141,14 @@ void OnTableChanged (TableMapping table, NotifyTableChangedAction action) } public event EventHandler TableChanged; + + public static void RegisterFastColumnSetter ( + Type type, + string name, + Action setter) + { + FastColumnSetter.RegisterFastColumnSetter (type, name, setter); + } } public class NotifyTableChangedEventArgs : EventArgs @@ -3038,7 +3048,16 @@ public IEnumerable ExecuteDeferredQuery (TableMapping map) continue; if (fastColumnSetters[i] != null) { - fastColumnSetters[i].Invoke (obj, stmt, i); + try { + fastColumnSetters[i].Invoke (obj, stmt, i); + } +#pragma warning disable CS0618 // Type or member is obsolete + catch (ExecutionEngineException) { +#pragma warning restore CS0618 // Type or member is obsolete + // Column setter as AOT Problem so don't use it. + fastColumnSetters[i] = null; + Trace.WriteLine($"FastMapper AOT Jit Exception on Type {map.MappedType.FullName} Column {cols[i].Name}"); + } } else { var colType = SQLite3.ColumnType (stmt, i); @@ -3365,6 +3384,14 @@ object ReadCol (Sqlite3Statement stmt, int index, SQLite3.ColType type, Type clr internal class FastColumnSetter { + private static ConcurrentDictionary<(Type, string), Action> customSetter = + new ConcurrentDictionary<(Type, string), Action> (); + + public static void RegisterFastColumnSetter(Type type, string name, Action setter) + { + customSetter[(type, name)] = setter; + } + /// /// Creates a delegate that can be used to quickly set object members from query columns. /// @@ -3381,7 +3408,9 @@ internal class FastColumnSetter /// internal static Action GetFastSetter (SQLiteConnection conn, TableMapping.Column column) { - Action fastSetter = null; + if (customSetter.TryGetValue ((typeof(T), column.Name), out var fastSetter)) { + return fastSetter; + } Type clrType = column.PropertyInfo.PropertyType; From de0e98e84b8294216af02d03803dab2108ea4139 Mon Sep 17 00:00:00 2001 From: Thomas Stocker Date: Mon, 6 Sep 2021 02:16:52 +0200 Subject: [PATCH 02/17] fixed spelling --- src/SQLite.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index a4dca86e..8185ef78 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -3054,7 +3054,7 @@ public IEnumerable ExecuteDeferredQuery (TableMapping map) #pragma warning disable CS0618 // Type or member is obsolete catch (ExecutionEngineException) { #pragma warning restore CS0618 // Type or member is obsolete - // Column setter as AOT Problem so don't use it. + // Column setter has AOT Problem so don't use it. fastColumnSetters[i] = null; Trace.WriteLine($"FastMapper AOT Jit Exception on Type {map.MappedType.FullName} Column {cols[i].Name}"); } From 8352f4b20db912b64231bc3a4de4032e4c8e2b3f Mon Sep 17 00:00:00 2001 From: Thomas Stocker Date: Mon, 6 Sep 2021 02:18:37 +0200 Subject: [PATCH 03/17] Correct Name --- src/SQLite.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index 8185ef78..6ab8b9be 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -3056,7 +3056,7 @@ public IEnumerable ExecuteDeferredQuery (TableMapping map) #pragma warning restore CS0618 // Type or member is obsolete // Column setter has AOT Problem so don't use it. fastColumnSetters[i] = null; - Trace.WriteLine($"FastMapper AOT Jit Exception on Type {map.MappedType.FullName} Column {cols[i].Name}"); + Trace.WriteLine($"FastColumnSetter AOT Jit Exception on Type {map.MappedType.FullName} Column {cols[i].Name}"); } } else { From a60a2645a0f282175fda9aac4e1d1d91544c7572 Mon Sep 17 00:00:00 2001 From: Thomas Stocker Date: Thu, 9 Sep 2021 11:26:07 +0200 Subject: [PATCH 04/17] Update SQLite.cs Read value that could not be read by default implmentation --- src/SQLite.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SQLite.cs b/src/SQLite.cs index 6ab8b9be..9f41f34a 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -3057,6 +3057,7 @@ public IEnumerable ExecuteDeferredQuery (TableMapping map) // Column setter has AOT Problem so don't use it. fastColumnSetters[i] = null; Trace.WriteLine($"FastColumnSetter AOT Jit Exception on Type {map.MappedType.FullName} Column {cols[i].Name}"); + i--; // go one back and read it with default implementation } } else { From 2464447e0d6b6bda6cb73364a382de2a1aaa790d Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Wed, 26 Jul 2023 16:27:53 +0200 Subject: [PATCH 05/17] retarget Tests to .NET 6.0 Because .NET 3.1 is end of life --- tests/SQLite.Tests/SQLite.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SQLite.Tests/SQLite.Tests.csproj b/tests/SQLite.Tests/SQLite.Tests.csproj index 1d9224f8..8c0db897 100644 --- a/tests/SQLite.Tests/SQLite.Tests.csproj +++ b/tests/SQLite.Tests/SQLite.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 false From 647576547f46814ff020ce3e7819620c59283b69 Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 14:59:27 +0100 Subject: [PATCH 06/17] roll forward last minor --- global.json | 1 + 1 file changed, 1 insertion(+) diff --git a/global.json b/global.json index 8a1056e1..8c95f992 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,6 @@ { "sdk": { "version": "8.0.100" + "rollForward": "latestMinor", } } \ No newline at end of file From 49ceeb970cb5a9cc486fc1e8a81aad7be2e5d479 Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 15:01:36 +0100 Subject: [PATCH 07/17] fixing build --- SQLite.sln | 74 +++++++++++++++++++++++++++++------------------------ global.json | 4 +-- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/SQLite.sln b/SQLite.sln index a6329bc1..53e8e82e 100644 --- a/SQLite.sln +++ b/SQLite.sln @@ -1,108 +1,114 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34707.107 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A0E59A10-7BD0-4554-B133-66FA850159BE}" ProjectSection(SolutionItems) = preProject + global.json = global.json Makefile = Makefile README.md = README.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-std", "nuget\SQLite-net-std\SQLite-net-std.csproj", "{081D08D6-10F1-431B-88FE-469FD9FE898C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-std", "nuget\SQLite-net-std\SQLite-net-std.csproj", "{081D08D6-10F1-431B-88FE-469FD9FE898C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDiff", "tests\ApiDiff\ApiDiff.csproj", "{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiDiff", "tests\ApiDiff\ApiDiff.csproj", "{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-base", "nuget\SQLite-net-base\SQLite-net-base.csproj", "{53D1953C-3641-47D0-BE08-14DB853CC576}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-base", "nuget\SQLite-net-base\SQLite-net-base.csproj", "{53D1953C-3641-47D0-BE08-14DB853CC576}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-sqlcipher", "nuget\SQLite-net-sqlcipher\SQLite-net-sqlcipher.csproj", "{59DB03EF-E28D-431E-9058-74AF316800EE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-sqlcipher", "nuget\SQLite-net-sqlcipher\SQLite-net-sqlcipher.csproj", "{59DB03EF-E28D-431E-9058-74AF316800EE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Tests", "tests\SQLite.Tests\SQLite.Tests.csproj", "{80B66A43-B358-4438-BF06-6351B86B121A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite.Tests", "tests\SQLite.Tests\SQLite.Tests.csproj", "{80B66A43-B358-4438-BF06-6351B86B121A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-static", "nuget\SQLite-net-static\SQLite-net-static.csproj", "{7CD60DAE-D505-4C2E-80B3-296556CE711E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-static", "nuget\SQLite-net-static\SQLite-net-static.csproj", "{7CD60DAE-D505-4C2E-80B3-296556CE711E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU + Debug|iPhone = Debug|iPhone Debug|iPhoneSimulator = Debug|iPhoneSimulator + Release|Any CPU = Release|Any CPU Release|iPhone = Release|iPhone Release|iPhoneSimulator = Release|iPhoneSimulator - Debug|iPhone = Debug|iPhone EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.Build.0 = Release|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.Build.0 = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.Build.0 = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhone.ActiveCfg = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhone.Build.0 = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.Build.0 = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|Any CPU.Build.0 = Release|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.Build.0 = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|Any CPU.Build.0 = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhone.ActiveCfg = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhone.Build.0 = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.Build.0 = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|Any CPU.Build.0 = Release|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.Build.0 = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|Any CPU.Build.0 = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhone.ActiveCfg = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhone.Build.0 = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.Build.0 = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.Build.0 = Release|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.Build.0 = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.Build.0 = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhone.ActiveCfg = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhone.Build.0 = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.Build.0 = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.Build.0 = Release|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.Build.0 = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.Build.0 = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhone.ActiveCfg = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhone.Build.0 = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.Build.0 = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|Any CPU.Build.0 = Release|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.Build.0 = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|Any CPU.Build.0 = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhone.ActiveCfg = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhone.Build.0 = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.Build.0 = Debug|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {1DEF735C-B973-4ED9-8446-7FFA6D0B410B} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF} diff --git a/global.json b/global.json index 8c95f992..dd9af827 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { "version": "8.0.100" - "rollForward": "latestMinor", + "rollForward": "latestMinor" } -} \ No newline at end of file +} From 2f90c314272d448b025057d11bc40d0cd5f84b1b Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 15:01:54 +0100 Subject: [PATCH 08/17] fixing global.json --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index dd9af827..79379c18 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100" + "version": "8.0.100", "rollForward": "latestMinor" } } From accbe0efa3d29a687ab089b9954d5a638c95217f Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 15:10:13 +0100 Subject: [PATCH 09/17] update tests --- tests/SQLite.Tests/SQLite.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SQLite.Tests/SQLite.Tests.csproj b/tests/SQLite.Tests/SQLite.Tests.csproj index bbb743fd..05ce2c74 100644 --- a/tests/SQLite.Tests/SQLite.Tests.csproj +++ b/tests/SQLite.Tests/SQLite.Tests.csproj @@ -9,7 +9,7 @@ - + From 7dddbd67aef5cff67741a96dab92ec78faff9cc5 Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 15:10:59 +0100 Subject: [PATCH 10/17] increase version number --- Directory.Build.props | 2 +- SQLite.sln | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 28f8be5b..0dff1e8a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ 1.9 - + 1 Logo-low.png https://github.com/praeclarum/sqlite-net diff --git a/SQLite.sln b/SQLite.sln index 53e8e82e..586c3d13 100644 --- a/SQLite.sln +++ b/SQLite.sln @@ -5,6 +5,7 @@ VisualStudioVersion = 17.10.34707.107 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A0E59A10-7BD0-4554-B133-66FA850159BE}" ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props global.json = global.json Makefile = Makefile README.md = README.md From ffa45b3d745afe496d923882f09bf311fbe0ed40 Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 15:13:02 +0100 Subject: [PATCH 11/17] fixing version --- Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 0dff1e8a..7e1aeec0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 1.9 - 1 + 1.9.1 + Logo-low.png https://github.com/praeclarum/sqlite-net From 2e2772c2956735b8328048074f464f9e3eb1f09c Mon Sep 17 00:00:00 2001 From: Inforithmics Date: Thu, 28 Mar 2024 15:18:08 +0100 Subject: [PATCH 12/17] version number --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7e1aeec0..b680839c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.9.1 + 1.9.173 Logo-low.png From ef58b8412d7b0aceeb32ec2ea6eab5c732b24a4a Mon Sep 17 00:00:00 2001 From: inforithmics Date: Wed, 5 Mar 2025 13:20:02 +0100 Subject: [PATCH 13/17] Revert Solution changes --- SQLite.sln | 75 +++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/SQLite.sln b/SQLite.sln index 586c3d13..a6329bc1 100644 --- a/SQLite.sln +++ b/SQLite.sln @@ -1,115 +1,108 @@  -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.10.34707.107 -MinimumVisualStudioVersion = 10.0.40219.1 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A0E59A10-7BD0-4554-B133-66FA850159BE}" ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - global.json = global.json Makefile = Makefile README.md = README.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-std", "nuget\SQLite-net-std\SQLite-net-std.csproj", "{081D08D6-10F1-431B-88FE-469FD9FE898C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-std", "nuget\SQLite-net-std\SQLite-net-std.csproj", "{081D08D6-10F1-431B-88FE-469FD9FE898C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiDiff", "tests\ApiDiff\ApiDiff.csproj", "{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDiff", "tests\ApiDiff\ApiDiff.csproj", "{1DEF735C-B973-4ED9-8446-7FFA6D0B410B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-base", "nuget\SQLite-net-base\SQLite-net-base.csproj", "{53D1953C-3641-47D0-BE08-14DB853CC576}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-base", "nuget\SQLite-net-base\SQLite-net-base.csproj", "{53D1953C-3641-47D0-BE08-14DB853CC576}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-sqlcipher", "nuget\SQLite-net-sqlcipher\SQLite-net-sqlcipher.csproj", "{59DB03EF-E28D-431E-9058-74AF316800EE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-sqlcipher", "nuget\SQLite-net-sqlcipher\SQLite-net-sqlcipher.csproj", "{59DB03EF-E28D-431E-9058-74AF316800EE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite.Tests", "tests\SQLite.Tests\SQLite.Tests.csproj", "{80B66A43-B358-4438-BF06-6351B86B121A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Tests", "tests\SQLite.Tests\SQLite.Tests.csproj", "{80B66A43-B358-4438-BF06-6351B86B121A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLite-net-static", "nuget\SQLite-net-static\SQLite-net-static.csproj", "{7CD60DAE-D505-4C2E-80B3-296556CE711E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite-net-static", "nuget\SQLite-net-static\SQLite-net-static.csproj", "{7CD60DAE-D505-4C2E-80B3-296556CE711E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|iPhone = Debug|iPhone - Debug|iPhoneSimulator = Debug|iPhoneSimulator Release|Any CPU = Release|Any CPU + Debug|iPhoneSimulator = Debug|iPhoneSimulator Release|iPhone = Release|iPhone Release|iPhoneSimulator = Release|iPhoneSimulator + Debug|iPhone = Debug|iPhone EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.Build.0 = Debug|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.ActiveCfg = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|Any CPU.Build.0 = Release|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhone.ActiveCfg = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhone.Build.0 = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {081D08D6-10F1-431B-88FE-469FD9FE898C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {081D08D6-10F1-431B-88FE-469FD9FE898C}.Debug|iPhone.Build.0 = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.Build.0 = Debug|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|Any CPU.Build.0 = Release|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhone.ActiveCfg = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhone.Build.0 = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {1DEF735C-B973-4ED9-8446-7FFA6D0B410B}.Debug|iPhone.Build.0 = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.Build.0 = Debug|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|Any CPU.ActiveCfg = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|Any CPU.Build.0 = Release|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhone.ActiveCfg = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhone.Build.0 = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {53D1953C-3641-47D0-BE08-14DB853CC576}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {53D1953C-3641-47D0-BE08-14DB853CC576}.Debug|iPhone.Build.0 = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.Build.0 = Debug|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|Any CPU.Build.0 = Release|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhone.ActiveCfg = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhone.Build.0 = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {59DB03EF-E28D-431E-9058-74AF316800EE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {59DB03EF-E28D-431E-9058-74AF316800EE}.Debug|iPhone.Build.0 = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.Build.0 = Debug|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.ActiveCfg = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|Any CPU.Build.0 = Release|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhone.ActiveCfg = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhone.Build.0 = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {80B66A43-B358-4438-BF06-6351B86B121A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {80B66A43-B358-4438-BF06-6351B86B121A}.Debug|iPhone.Build.0 = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.Build.0 = Debug|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|Any CPU.ActiveCfg = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|Any CPU.Build.0 = Release|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhone.ActiveCfg = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhone.Build.0 = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {7CD60DAE-D505-4C2E-80B3-296556CE711E}.Debug|iPhone.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {1DEF735C-B973-4ED9-8446-7FFA6D0B410B} = {FECC0E44-E626-49CB-BD8B-0CFBD93FBEFF} From 00117c606bfecd63f24d192f146cd6a8805a0658 Mon Sep 17 00:00:00 2001 From: inforithmics Date: Wed, 5 Mar 2025 13:24:51 +0100 Subject: [PATCH 14/17] undo changes --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index cdbb589e..d5bf446d 100644 --- a/global.json +++ b/global.json @@ -3,4 +3,4 @@ "version": "9.0.100", "rollForward": "latestFeature" } -} +} \ No newline at end of file From 390823e7d1b80aa7b24e976e402d416c3aa74fa6 Mon Sep 17 00:00:00 2001 From: inforithmics Date: Wed, 5 Mar 2025 13:44:21 +0100 Subject: [PATCH 15/17] Added FastColumnSetter Unit Tests --- tests/SQLite.Tests/FastColumnSetterTest.cs | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 tests/SQLite.Tests/FastColumnSetterTest.cs diff --git a/tests/SQLite.Tests/FastColumnSetterTest.cs b/tests/SQLite.Tests/FastColumnSetterTest.cs new file mode 100644 index 00000000..b2e0ca40 --- /dev/null +++ b/tests/SQLite.Tests/FastColumnSetterTest.cs @@ -0,0 +1,116 @@ +using System; +using System.Linq; +#if NETFX_CORE +using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; +using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute; +using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; +using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; +#else +using NUnit.Framework; +#endif + +namespace SQLite.Tests +{ + [TestFixture] + class FastColumnSetterTest + { + public class TestSetter + { + [AutoIncrement, PrimaryKey] + public int Id { get; set; } + + public string Data { get; set; } + + public DateTime Date { get; set; } + } + + public class TestDb : SQLiteConnection + { + public TestDb (String path) + : base (path) + { + CreateTable (); + } + } + + [Test] + public void SetFastColumnSetters_AndReadData() + { + FastColumnSetter.RegisterFastColumnSetter( + typeof(TestSetter), + nameof(TestSetter.Id), + (obj, stmt, index) => { ((TestSetter)obj).Id = SQLite3.ColumnInt(stmt, index); }); + + FastColumnSetter.RegisterFastColumnSetter ( + typeof (TestSetter), + nameof (TestSetter.Data), + (obj, stmt, index) => { ((TestSetter)obj).Data = SQLite3.ColumnString (stmt, index); }); + + FastColumnSetter.RegisterFastColumnSetter ( + typeof (TestSetter), + nameof (TestSetter.Date), + (obj, stmt, index) => { ((TestSetter)obj).Date = new DateTime (SQLite3.ColumnInt64 (stmt, index)); }); + + var n = 20; + var cq = from i in Enumerable.Range (1, n) + select new TestSetter { + Data = Convert.ToString (i), + Date = new DateTime (2013, 1, i) + }; + + var db = new TestDb (TestPath.GetTempFileName ()); + db.InsertAll (cq); + + var results = db.Table ().Where (o => o.Data.Equals ("10")); + Assert.AreEqual (results.Count (), 1); + Assert.AreEqual (results.FirstOrDefault ().Data, "10"); + } + + [Test] + public void SetFastColumnSetters_AndReadData_IsCalled() + { + int callCount = 0; + + FastColumnSetter.RegisterFastColumnSetter ( + typeof (TestSetter), + nameof (TestSetter.Id), + (obj, stmt, index) => { + ((TestSetter)obj).Id = SQLite3.ColumnInt (stmt, index); + callCount++; + }); + + FastColumnSetter.RegisterFastColumnSetter ( + typeof (TestSetter), + nameof (TestSetter.Data), + (obj, stmt, index) => { + ((TestSetter)obj).Data = SQLite3.ColumnString (stmt, index); + callCount++; + }); + + FastColumnSetter.RegisterFastColumnSetter ( + typeof (TestSetter), + nameof (TestSetter.Date), + (obj, stmt, index) => { + ((TestSetter)obj).Date = new DateTime (SQLite3.ColumnInt64 (stmt, index)); + callCount++; + }); + + var n = 20; + var cq = from i in Enumerable.Range (1, n) + select new TestSetter { + Data = Convert.ToString (i), + Date = new DateTime (2013, 1, i) + }; + + var db = new TestDb (TestPath.GetTempFileName ()); + db.InsertAll (cq); + + var results = db.Table ().Where (o => o.Data.Equals ("10")); + Assert.AreEqual (results.Count (), 1); + Assert.AreEqual (results.FirstOrDefault ().Data, "10"); + + Assert.IsTrue(callCount > 0); + } + } +} +} From 449e6e8efd05b6192057704bd600363d6e7e802d Mon Sep 17 00:00:00 2001 From: inforithmics Date: Wed, 5 Mar 2025 13:47:19 +0100 Subject: [PATCH 16/17] revert test changes --- tests/SQLite.Tests/SQLite.Tests.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/SQLite.Tests/SQLite.Tests.csproj b/tests/SQLite.Tests/SQLite.Tests.csproj index 05ce2c74..d44f218a 100644 --- a/tests/SQLite.Tests/SQLite.Tests.csproj +++ b/tests/SQLite.Tests/SQLite.Tests.csproj @@ -2,14 +2,16 @@ net8.0 + false + - + From f08d9c9fe4284e78b95d0048de1bb006ccad9038 Mon Sep 17 00:00:00 2001 From: inforithmics Date: Wed, 5 Mar 2025 13:48:13 +0100 Subject: [PATCH 17/17] fixed build --- tests/SQLite.Tests/FastColumnSetterTest.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/SQLite.Tests/FastColumnSetterTest.cs b/tests/SQLite.Tests/FastColumnSetterTest.cs index b2e0ca40..66efa0ba 100644 --- a/tests/SQLite.Tests/FastColumnSetterTest.cs +++ b/tests/SQLite.Tests/FastColumnSetterTest.cs @@ -12,7 +12,7 @@ namespace SQLite.Tests { [TestFixture] - class FastColumnSetterTest + public class FastColumnSetterTest { public class TestSetter { @@ -113,4 +113,3 @@ public void SetFastColumnSetters_AndReadData_IsCalled() } } } -}