From b599f47a8d1b289186100fa7f68ebc30b0d0e41d Mon Sep 17 00:00:00 2001 From: gilzoide Date: Thu, 30 Jan 2025 21:43:11 -0300 Subject: [PATCH] Fix support for struct in query results by disabling fast column setters --- src/SQLite.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SQLite.cs b/src/SQLite.cs index 1697fe9f..6bf324b9 100644 --- a/src/SQLite.cs +++ b/src/SQLite.cs @@ -3143,10 +3143,11 @@ public IEnumerable ExecuteDeferredQuery (TableMapping map) BindingFlags.NonPublic | BindingFlags.Static).MakeGenericMethod (map.MappedType); } + var canUseFastColumnSetter = !typeof(T).IsValueType; for (int i = 0; i < cols.Length; i++) { var name = SQLite3.ColumnName16 (stmt, i); cols[i] = map.FindColumn (name); - if (cols[i] != null) + if (canUseFastColumnSetter && cols[i] != null) if (getSetter != null) { fastColumnSetters[i] = (Action)getSetter.Invoke(null, new object[]{ _conn, cols[i]}); }