From 3387585a9b68357e76fd014e17b35b94fb5f6e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Sun, 7 Apr 2024 17:54:24 +0200 Subject: [PATCH] Make userVersion and useInsertReturning constants Not quite sure whether it may make sense to set userVersion? If that becomes an issue, we can still generate `nonisolated(unsafe)`. --- .../RecordGeneration/GenerateDatabaseStruct.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Libraries/LighterGeneration/RecordGeneration/GenerateDatabaseStruct.swift b/Plugins/Libraries/LighterGeneration/RecordGeneration/GenerateDatabaseStruct.swift index 5c59f3e..ca420f4 100644 --- a/Plugins/Libraries/LighterGeneration/RecordGeneration/GenerateDatabaseStruct.swift +++ b/Plugins/Libraries/LighterGeneration/RecordGeneration/GenerateDatabaseStruct.swift @@ -68,7 +68,7 @@ extension EnlighterASTGenerator { // Schema version - typeVariables.append(.var( + typeVariables.append(.let( public: options.public, "userVersion", is: .integer(database.userVersion), comment: "User version of the database (`PRAGMA user_version`)." @@ -84,7 +84,7 @@ extension EnlighterASTGenerator { // Whether SQLite3 supports returning (the user can override!) - typeVariables.append(.var( + typeVariables.append(.let( public: options.public, "useInsertReturning", is: .cmp( .call(name: "sqlite3_libversion_number"),