Software /
code /
prosody
Comparison
plugins/mod_storage_sql.lua @ 13852:ce4b4c2863f3 13.0
mod_storage_sql: Also retrieve all SQLite3 indices
Missed this in 2558be2daaca
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 16 Apr 2025 15:35:07 +0200 |
parent | 13845:2558be2daaca |
comparison
equal
deleted
inserted
replaced
13851:ecafafec7806 | 13852:ce4b4c2863f3 |
---|---|
877 end | 877 end |
878 else | 878 else |
879 local indices = {}; | 879 local indices = {}; |
880 engine:transaction(function () | 880 engine:transaction(function () |
881 if params.driver == "SQLite3" then | 881 if params.driver == "SQLite3" then |
882 for row in engine:select [[SELECT "name" FROM "sqlite_schema" WHERE "type"='index' AND "tbl_name"='prosody' AND "name"='prosody_index';]] do | 882 for row in engine:select [[SELECT "name" FROM "sqlite_schema" WHERE "type"='index' AND "tbl_name"='prosody';]] do |
883 indices[row[1]] = true; | 883 indices[row[1]] = true; |
884 end | 884 end |
885 elseif params.driver == "PostgreSQL" then | 885 elseif params.driver == "PostgreSQL" then |
886 for row in engine:select [[SELECT "indexname" FROM "pg_indexes" WHERE "tablename"='prosody';]] do | 886 for row in engine:select [[SELECT "indexname" FROM "pg_indexes" WHERE "tablename"='prosody';]] do |
887 indices[row[1]] = true; | 887 indices[row[1]] = true; |