aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
Commit message (Collapse)AuthorAgeFilesLines
* mod_storage_sql: Drop archive timestamp precision pending schema updateKim Alvefur2022-08-141-1/+2
| | | | | | The "when" column is an INTEGER which will probably be unhappy about storing higher precision timestamps, so we keep the older behavior for now.
* Merge 0.12->trunkKim Alvefur2022-07-291-4/+2
|\
| * mod_storage_sql: Fix summary API with Postgres (fixes #1766)Kim Alvefur2022-07-221-4/+2
| | | | | | | | | | | | | | The ORDER BY and LIMIT clauses are not needed and don't even make much sense. This part was most likely a leftover from the :find method. Tested with sqlite and postgres 14
* | Merge 0.12->trunkKim Alvefur2022-07-271-1/+1
|\|
| * mod_storage_sql: Fix bypass of load procedure under prosodyctlKim Alvefur2022-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | There's no 'prosody.prosodyctl' property other than this one, introduced in 6216743c188c in 2015. Guessing that the intent was to skip this when running as a prosodyctl command. The module.command code does its own version of this initialization, so this seems likely. Thanks raja for noticing
* | compat: Remove handling of Lua 5.1 location of 'unpack' functionKim Alvefur2022-07-111-1/+1
| |
* | mod_storage_sql: Remove Lua 5.1 compatibility hackKim Alvefur2022-07-021-2/+1
|/ | | | Part of #1600
* mod_storage_sql: Return cached total where it makes senseKim Alvefur2021-11-301-4/+9
| | | | | This should skip the summary SQL query when not needed, ie when the cached value can be used directly.
* mod_storage_sql: Adjust handling of 'total' for multi-id queriesKim Alvefur2021-11-301-2/+3
| | | | | Otherwise a query for a set of ids may cause that value to be cached, despite only covering a subset.
* mod_storage_sql: Fix traceback on multi-user deletionKim Alvefur2021-11-301-2/+6
| | | | | | | jid.join(true, ...) fails. Since we don't know which users this affects, best to clear the whole cache.
* mod_storage_sql: Expose multi-user deletion capabilityKim Alvefur2021-11-301-0/+1
| | | | | archive_store:delete(true) deletes messages for all users, which would allow some simplification when this is supported.
* mod_storage_sql: Fix for move of yes/no function (Thanks Kasim)Kim Alvefur2021-06-211-2/+2
|
* mod_storage_sql: Implement map-like API for archivesKim Alvefur2021-02-011-0/+47
| | | | | | | | Used by mod_http_file_share, muc moderation, etc. Tests tweaked because they failed on stanza internals that happen becasue of re-serialization. Namespaces differ since inheritance is implicit when building but explicit after parsing.
* mod_storage_sql: Fix compatibilty with Lua 5.1Kim Alvefur2021-01-131-1/+2
| | | | | | string.rep() doesn't have the 3rd argument before Lua 5.2 Revert once we drop support for Lua 5.1
* mod_storage_sql: Support query for set of IDsKim Alvefur2021-01-121-0/+10
| | | | Not compatible with Lua 5.1
* mod_storage_sql: Advertise support for id range queryKim Alvefur2021-01-091-0/+1
| | | | That is, a query for items between two IDs (not inclusive).
* mod_storage_sql: Measure hits/misses on the item count cacheKim Alvefur2020-07-021-0/+7
| | | | | A cache miss can be expensive so having numbers on how often this occurs may be valuable.
* mod_storage_sql: Fix incorrect results when fetching items before specific ↵Matthew Wild2020-06-121-1/+1
| | | | | | archive id Copy/paste error, introduced in deb68066c7aa
* mod_storage_sql: Log database connection parameters when creating engineKim Alvefur2020-05-021-2/+3
| | | | | | This is meant to help trace down an issue where Prosody apparently creates multiple conflicting SQL engines, causing problems especially with SQLite3, e.g. #616 #784.
* Merge 0.11->trunkKim Alvefur2020-03-221-0/+1
|\
| * mod_storage_sql: Add index covering sort_id to improve performance (fixes #1505)Kim Alvefur2020-03-221-0/+1
| |
* | storagemanager, mod_storage_sql: Rename methods to :get_all() and :delete_all()Matthew Wild2020-03-111-4/+4
| |
* | mod_storage_sql: Add map_store:find_key() and map_store:delete_key() (+ tests)Matthew Wild2020-03-111-0/+44
| |
* | Merge 0.11->trunkKim Alvefur2020-02-221-6/+6
|\|
| * mod_storage_sql: Move update limit check back one step, fixes tracebackKim Alvefur2020-02-221-6/+6
| | | | | | | | | | 0c00274528a4 moved it one step too far, so the check was performed before connecting to the database instead of after.
* | Merge 0.11->trunkKim Alvefur2020-02-211-7/+7
|\|
| * mod_storage_sql: Fix check for deletion limits (fixes #1494)Kim Alvefur2020-02-211-7/+7
| | | | | | | | | | The check was only performed if sql_manage_tables was set to true (the default) It should always be performed
* | mod_storage_sql: Remove unused and not actually returned return value [luacheck]Kim Alvefur2019-12-241-1/+1
| | | | | | | | The :delete throws an error, it does not return one like this.
* | mod_storage_*: Also include timestmap of first message in :summary APIKim Alvefur2019-08-231-3/+5
| | | | | | | | | | For completeness along with most recent timestamp. Might be nice to be able to order by oldest unread message.
* | mod_storage_*: Include timestamp of latest message in :summary APIKim Alvefur2019-08-231-1/+4
| | | | | | | | | | | | | | Clients may want to show a list of conversations ordered by how timestamp of most recent message. The counts allow a badge with unread message counter.
* | mod_storage_*: Tweak :summary API to allow future expansion with more fieldsKim Alvefur2019-08-231-3/+5
| | | | | | | | Eg might want to include last message, timestamp, chat state or other info.
* | mod_storage_sql: Ignore shadowed error variable [luacheck]Kim Alvefur2019-05-281-1/+1
| |
* | mod_storage_sql: Fix to use correct arguments to archive id lookupKim Alvefur2019-05-281-2/+2
| |
* | mod_storage_sql: Correctly return item-not-found errorKim Alvefur2019-05-281-2/+3
| | | | | | | | `return ok, err` comes out as `transaction_ok, ok, err`
* | mod_storage_sql: Look up archive IDs in separate queries (fixes #1325)Kim Alvefur2019-03-231-29/+29
| | | | | | | | This is probably not good for performance.
* | Merge 0.11->trunkKim Alvefur2019-05-261-14/+22
|\|
| * mod_storage_sql: Handle SQLite DELETE with LIMIT being optional (fixes #1359)Kim Alvefur2019-05-131-6/+15
| |
| * mod_storage_sql: Move code out of if-else chainKim Alvefur2019-05-131-9/+8
| |
* | mod_storage_sql: Add support for iterating over users in archive storesKim Alvefur2019-05-051-0/+13
| |
* | mod_storage_sql: Implement archive summary APIKim Alvefur2019-02-251-0/+35
| |
* | mod_storage_sql: No archive item limit by defaultKim Alvefur2019-03-221-4/+6
| |
* | mod_storage_sql: Return cached count if only this is queried forKim Alvefur2019-03-221-1/+5
| |
* | mod_storage_sql: Cache total count if it's calculated as part of the current ↵Kim Alvefur2019-03-221-0/+3
| | | | | | | | query
* | mod_storage_sql: Skip cache writeKim Alvefur2019-03-221-1/+0
| | | | | | | | | | This would cause the cache to be wrong in case the the later INSERT fails and the transaction is aborted.
* | mod_storage_sql: Fix to use currently queried storeKim Alvefur2019-03-221-2/+2
| | | | | | | | | | Was using the previously queried store due to this being cached in an upvalue.
* | mod_storage_sql: Don't increment counter twice (fixes accounting error)Kim Alvefur2019-03-221-1/+0
| |
* | mod_storage_internal,_sql: Key item count cache on both username and storeKim Alvefur2019-03-221-5/+8
| |
* | mod_storage_internal,_sql: Expose archive capabilities feature setKim Alvefur2019-03-221-0/+2
| | | | | | | | This was planned to be added long ago but was forgotten.
* | mod_storage_internal,_sql: Add limit to number of items in an archive store ↵Matthew Wild2017-10-201-1/+38
| | | | | | | | (fixes #733)
* | various: Don't rely on _G.unpack existingKim Alvefur2018-12-081-1/+1
|/