Kim Alvefur
5952f52d99
mod_storage_sql: Implement map-like API for archives
...
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.
5 years ago
Kim Alvefur
e332c17410
mod_storage_sql: Fix compatibilty with Lua 5.1
...
string.rep() doesn't have the 3rd argument before Lua 5.2
Revert once we drop support for Lua 5.1
5 years ago
Kim Alvefur
37ce2dfd7e
mod_storage_sql: Support query for set of IDs
...
Not compatible with Lua 5.1
5 years ago
Kim Alvefur
0f71656698
mod_storage_sql: Advertise support for id range query
...
That is, a query for items between two IDs (not inclusive).
5 years ago
Kim Alvefur
72129eca1c
mod_storage_sql: Measure hits/misses on the item count cache
...
A cache miss can be expensive so having numbers on how often this occurs
may be valuable.
6 years ago
Kim Alvefur
277b88a8de
mod_storage_sql: Add index covering sort_id to improve performance ( fixes #1505 )
6 years ago
Kim Alvefur
60a3d89260
mod_storage_sql: Move update limit check back one step, fixes traceback
...
0c00274528a4 moved it one step too far, so the check was performed
before connecting to the database instead of after.
6 years ago
Kim Alvefur
e1fe3bab8f
mod_storage_sql: Fix check for deletion limits ( fixes #1494 )
...
The check was only performed if sql_manage_tables was set to true (the default)
It should always be performed
6 years ago
Kim Alvefur
daa4995fdb
mod_storage_sql: Add index covering sort_id to improve performance ( fixes #1505 )
6 years ago
Kim Alvefur
0a4ab36741
mod_storage_sql: Move update limit check back one step, fixes traceback
...
0c00274528a4 moved it one step too far, so the check was performed
before connecting to the database instead of after.
6 years ago
Kim Alvefur
d924dbc40d
mod_storage_sql: Fix check for deletion limits ( fixes #1494 )
...
The check was only performed if sql_manage_tables was set to true (the default)
It should always be performed
6 years ago
Kim Alvefur
51f4e1c896
mod_storage_sql: Add index covering sort_id to improve performance ( fixes #1505 )
6 years ago
Kim Alvefur
e69d6a21b3
mod_storage_sql: Move update limit check back one step, fixes traceback
...
0c00274528a4 moved it one step too far, so the check was performed
before connecting to the database instead of after.
6 years ago
Kim Alvefur
a8812b45ad
mod_storage_sql: Fix check for deletion limits ( fixes #1494 )
...
The check was only performed if sql_manage_tables was set to true (the default)
It should always be performed
6 years ago
Matthew Wild
c96212e146
mod_storage_sql: Fix incorrect results when fetching items before specific archive id
...
Copy/paste error, introduced in deb68066c7aa
6 years ago
Kim Alvefur
0c677709af
mod_storage_sql: Log database connection parameters when creating engine
...
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 .
6 years ago
Matthew Wild
f2ac7bdb80
storagemanager, mod_storage_sql: Rename methods to :get_all() and :delete_all()
6 years ago
Matthew Wild
d669797472
mod_storage_sql: Add map_store:find_key() and map_store:delete_key() (+ tests)
6 years ago
Kim Alvefur
dec1bce0de
mod_storage_sql: Remove unused and not actually returned return value [luacheck]
...
The :delete throws an error, it does not return one like this.
6 years ago
Kim Alvefur
9838f3732d
mod_storage_sql: Handle SQLite DELETE with LIMIT being optional ( fixes #1359 )
7 years ago
Kim Alvefur
1045642fa4
mod_storage_sql: Move code out of if-else chain
7 years ago
Kim Alvefur
efd7a8c226
mod_storage_*: Also include timestmap of first message in :summary API
...
For completeness along with most recent timestamp. Might be nice to be
able to order by oldest unread message.
6 years ago
Kim Alvefur
5a382ce091
mod_storage_*: Include timestamp of latest message in :summary API
...
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.
6 years ago
Kim Alvefur
24670cf607
mod_storage_*: Tweak :summary API to allow future expansion with more fields
...
Eg might want to include last message, timestamp, chat state or other info.
6 years ago
Kim Alvefur
411d4c02a1
mod_storage_sql: Ignore shadowed error variable [luacheck]
7 years ago
Kim Alvefur
a52c045f4a
mod_storage_sql: Fix to use correct arguments to archive id lookup
7 years ago
Kim Alvefur
8799bf12c7
mod_storage_sql: Correctly return item-not-found error
...
`return ok, err` comes out as `transaction_ok, ok, err`
7 years ago
Kim Alvefur
7e32666c2b
mod_storage_sql: Look up archive IDs in separate queries ( fixes #1325 )
...
This is probably not good for performance.
7 years ago
Kim Alvefur
696da1f571
mod_storage_sql: Add support for iterating over users in archive stores
7 years ago
Kim Alvefur
663a4c3933
mod_storage_sql: Handle SQLite DELETE with LIMIT being optional ( fixes #1359 )
7 years ago
Kim Alvefur
6bf96583fa
mod_storage_sql: Move code out of if-else chain
7 years ago
Matthew Wild
7a66697c6a
mod_storage_sql: Catch errors during schema upgrade (thanks Nothing4You)
7 years ago
Kim Alvefur
649e063e85
mod_storage_sql: Handle Lua 5.3 move of unpack function
7 years ago
Matthew Wild
b509a1b16f
mod_storage_sql: Fix issue number in comment that was fixed by 55b40f3fa659 ( fixes #1073 )
7 years ago
Matthew Wild
9ae8e96685
mod_storage_sql: Keep prosodyarchive_index unique constraint on non-MySQL DBs
7 years ago
Matthew Wild
9ddebb7bbf
mod_storage_sql: Change prosodyarchive_index to be non-unique ( fixes #1087 )
...
MySQL requires that the first 20 bytes are unique, even if they differ after
the first 20 bytes. This breaks e.g. pubsub/PEP nodes longer than 20 characters
that have common prefixes.
7 years ago
Matthew Wild
23fd5679ed
mod_storage_sql: Have :users() throw an error on failure instead of returning non-iterator values
7 years ago
Matthew Wild
41a32414b0
mod_storage_sql: Workaround MySQL not supporting LIMIT subquery in archive truncate operations, fixes #1200
7 years ago
Kim Alvefur
2e59708c47
mod_storage_sql: Remove unused function argument [luacheck]
...
What was the intent of this argument anyways?
7 years ago
Kim Alvefur
98e2e58ff6
mod_storage_sql: Index over contact and timestamp (happy now Ge0rg?)
8 years ago
Kim Alvefur
fa77fa5b16
mod_storage_sql: Add indices that include the with and when columns of archives
8 years ago
Kim Alvefur
621ee7226f
mod_storage_sql: Also clear the prosodyarchive table when an user is deleted ( fixes #1009 )
8 years ago
Kim Alvefur
5dcdfde228
mod_storage_sql: Remove return values from purge method
8 years ago
Matthew Wild
f9ef95d5e6
mod_storage_sql: Fix logic error introduced by variable rename in aa9f198cb3c9 (thanks waqas)
9 years ago
Kim Alvefur
6670a5b179
mod_storage_sql: Limit encoding check to current database
9 years ago
Kim Alvefur
4c698e988d
mod_storage_sql: Break long lines
9 years ago
Kim Alvefur
460b03bec9
mod_storage_sql: Pass charset and collation names via variable binding
9 years ago
Kim Alvefur
44116c253f
mod_storage_sql: Quote some field names
9 years ago
Kim Alvefur
2d381d6b38
mod_storage_sql: Raise error if encoding check query fails
9 years ago
Kim Alvefur
1796c07956
SQL: Use standard quotes for columns and other identifiers, rewrite to grave accents for MySQL only ( fixes #885 )
9 years ago