Skip to content

Commit a00948f

Browse files
committed
Fix preserve ColumnInfo.Name property
This fixes the "duplicate column name" error on builds with managed code stripping enabled.
1 parent 59ea39e commit a00948f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Plugins/tools~/fix-library-path.sed

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@
2929
s/static string Quote/public static string Quote/
3030

3131
# Make SQLite3 class partial, to extend in another file
32-
s/class SQLite3/partial class SQLite3/
32+
s/class SQLite3/partial class SQLite3/
33+
34+
# Add [RequiredMember] attribute to ColumnInfo.Name property
35+
# This fixes managed code stripping removing its setter method
36+
s/Column ("name")/Column ("name"), UnityEngine.Scripting.RequiredMember/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,4 @@ Third-party code:
113113
- `SQLiteConnection.Quote` is made public.
114114
This is be useful for libraries making raw queries.
115115
- `SQLite3.SetDirectory` is only defined in Windows platforms.
116+
- Adds a `[RequiredMember]` attribute to `ColumnInfo.Name` property, fixing errors on columns when managed code stripping is enabled.

Runtime/sqlite-net/SQLite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ public class ColumnInfo
794794
{
795795
// public int cid { get; set; }
796796

797-
[Column ("name")]
797+
[Column ("name"), UnityEngine.Scripting.RequiredMember]
798798
public string Name { get; set; }
799799

800800
// [Column ("type")]

0 commit comments

Comments
 (0)