# HG changeset patch # User Kim Alvefur # Date 1686427243 -7200 # Node ID af251471d5aea03296923107400e57fec2854921 # Parent 033ea8b46d6a1bbe990c643ca3bc8ccf24a4a782 util.sqlite3: Fix indentation diff -r 033ea8b46d6a -r af251471d5ae util/sqlite3.lua --- a/util/sqlite3.lua Sat Jun 10 16:39:48 2023 +0200 +++ b/util/sqlite3.lua Sat Jun 10 22:00:43 2023 +0200 @@ -202,10 +202,10 @@ }; local function iterator(table) - local i=0; + local i = 0; return function() - i=i+1; - local item=table[i]; + i = i + 1; + local item = table[i]; if item ~= nil then return item; end @@ -268,6 +268,7 @@ end return setmetatable({ __affected = affected, __rowcount = rowcount }, result_mt); end + engine.insert = engine.execute_update; engine.select = engine.execute_query; engine.delete = engine.execute_update; @@ -371,10 +372,11 @@ end return success; end + function engine:set_encoding() -- to UTF-8 return self:transaction(function() - for encoding in self:select"PRAGMA encoding;" do - if encoding[1] == "UTF-8" then + for encoding in self:select "PRAGMA encoding;" do + if encoding[1] == "UTF-8" then self.charset = "utf8"; end end