aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-06-10 22:00:43 +0200
committerKim Alvefur <zash@zash.se>2023-06-10 22:00:43 +0200
commiteaf8765ee99637dc218e7a2b71a2e9dc353b9c09 (patch)
tree2608ed89b31524eea63fdf6d0cd4312c3e4e3465 /util
parent1ece33405d78fe38c9adae66cb8aca1d325a40a7 (diff)
downloadprosody-eaf8765ee99637dc218e7a2b71a2e9dc353b9c09.tar.gz
prosody-eaf8765ee99637dc218e7a2b71a2e9dc353b9c09.zip
util.sqlite3: Fix indentation
Diffstat (limited to 'util')
-rw-r--r--util/sqlite3.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/util/sqlite3.lua b/util/sqlite3.lua
index 83c0d26d..82e093c7 100644
--- a/util/sqlite3.lua
+++ b/util/sqlite3.lua
@@ -202,10 +202,10 @@ local result_mt = {
};
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 @@ function engine:execute_update(sql, ...)
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 @@ function engine:_create_table(table)
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