Kim Alvefur
68bd24d94c
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
2021-01-13 15:33:44 +01:00
Kim Alvefur
3c919b0ad4
mod_storage_sql: Support query for set of IDs
...
Not compatible with Lua 5.1
2021-01-12 18:46:17 +01:00
Kim Alvefur
ae0d560197
mod_storage_sql: Advertise support for id range query
...
That is, a query for items between two IDs (not inclusive).
2021-01-09 21:08:33 +01:00
Kim Alvefur
18525691a4
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.
2020-07-02 19:03:59 +02:00
Matthew Wild
371d05a0c6
mod_storage_sql: Fix incorrect results when fetching items before specific archive id
...
Copy/paste error, introduced in deb68066c7aa
2020-06-12 16:54:38 +01:00
Kim Alvefur
75a3d7758b
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 .
2020-05-02 14:13:02 +02:00
Kim Alvefur
1724e9a271
Merge 0.11->trunk
2020-03-22 21:13:09 +01:00
Kim Alvefur
65a654d726
mod_storage_sql: Add index covering sort_id to improve performance ( fixes #1505 )
2020-03-22 21:05:59 +01:00
Matthew Wild
cb6148d155
storagemanager, mod_storage_sql: Rename methods to :get_all() and :delete_all()
2020-03-11 16:32:41 +00:00
Matthew Wild
33b9b2b91e
mod_storage_sql: Add map_store:find_key() and map_store:delete_key() (+ tests)
2020-03-11 15:57:53 +00:00
Kim Alvefur
132191f6ff
Merge 0.11->trunk
2020-02-22 16:26:20 +01:00
Kim Alvefur
6e53a3a601
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.
2020-02-22 16:23:43 +01:00
Kim Alvefur
aa6a550ceb
Merge 0.11->trunk
2020-02-21 23:01:43 +01:00
Kim Alvefur
84e0c87b7e
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
2020-02-21 23:00:44 +01:00
Kim Alvefur
96c1406bcd
mod_storage_sql: Remove unused and not actually returned return value [luacheck]
...
The :delete throws an error, it does not return one like this.
2019-12-24 00:49:43 +01:00
Kim Alvefur
9d5e31fd48
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.
2019-08-23 01:15:44 +02:00
Kim Alvefur
d3c559bcc8
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.
2019-08-23 01:10:27 +02:00
Kim Alvefur
39cb87a158
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.
2019-08-23 01:04:00 +02:00
Kim Alvefur
e5423a5f05
mod_storage_sql: Handle SQLite DELETE with LIMIT being optional ( fixes #1359 )
2019-05-13 14:39:38 +02:00
Kim Alvefur
e54ee56ed1
mod_storage_sql: Move code out of if-else chain
2019-05-13 14:47:41 +02:00
Matthew Wild
813f69fd2b
mod_storage_sql: Catch errors during schema upgrade (thanks Nothing4You)
2018-11-15 21:55:16 +00:00
Kim Alvefur
c5d487e42d
mod_storage_sql: Handle Lua 5.3 move of unpack function
2018-10-21 21:12:38 +02:00
Matthew Wild
fcdc8d9ff1
mod_storage_sql: Fix issue number in comment that was fixed by 55b40f3fa659 ( fixes #1073 )
2018-10-13 08:17:58 +01:00
Matthew Wild
1faf1773a3
mod_storage_sql: Keep prosodyarchive_index unique constraint on non-MySQL DBs
2018-10-12 21:59:15 +01:00
Matthew Wild
06cdd9edcd
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.
2018-10-11 19:23:21 +01:00
Matthew Wild
9423dbfdb3
mod_storage_sql: Have :users() throw an error on failure instead of returning non-iterator values
2018-10-11 19:15:46 +01:00
Matthew Wild
21e358c847
mod_storage_sql: Workaround MySQL not supporting LIMIT subquery in archive truncate operations, fixes #1200
2018-10-11 18:20:09 +01:00
Kim Alvefur
c7ef245c0b
mod_storage_sql: Remove unused function argument [luacheck]
...
What was the intent of this argument anyways?
2018-10-10 21:23:35 +02:00
Kim Alvefur
18b6b5c90b
mod_storage_sql: Catch and report value deserialization errors
2018-02-24 11:50:08 +01:00
Kim Alvefur
689f3d3009
Merge 0.10->trunk
2017-12-22 01:02:05 +01:00
Kim Alvefur
cf3af7a85c
mod_storage_sql: Index over contact and timestamp (happy now Ge0rg?)
2017-12-12 01:40:09 +01:00
Kim Alvefur
852564c14e
mod_storage_sql: Remove ability to override name of key-value table (unreachable and would not work)
2017-12-11 22:45:03 +01:00
Kim Alvefur
cbfe174fa4
Merge 0.10->trunk
2017-11-21 23:16:16 +01:00
Kim Alvefur
a7693939d4
mod_storage_sql: Add indices that include the with and when columns of archives
2017-11-21 14:46:21 +01:00
Kim Alvefur
01d628a547
mod_storage_sql: Add support for truncating deletion
2017-11-09 16:50:36 +01:00
Kim Alvefur
5c1f8cfc4b
Merge 0.10->trunk
2017-10-05 18:06:04 +02:00
Kim Alvefur
ce996cdb1c
mod_storage_sql: Also clear the prosodyarchive table when an user is deleted ( fixes #1009 )
2017-10-05 17:44:47 +02:00
Kim Alvefur
50611461f2
mod_storage_sql: Remove return values from purge method
2017-10-05 17:22:42 +02:00
Matthew Wild
4812b7e07c
mod_storage_sql: Fix logic error introduced by variable rename in aa9f198cb3c9 (thanks waqas)
2017-04-30 10:44:53 +01:00
Kim Alvefur
caf3175a5f
mod_storage_sql: Limit encoding check to current database
2017-04-13 01:29:35 +02:00
Kim Alvefur
8aaba12933
mod_storage_sql: Break long lines
2017-04-12 23:16:23 +02:00
Kim Alvefur
d938b42d8f
mod_storage_sql: Pass charset and collation names via variable binding
2017-04-12 21:53:21 +02:00
Kim Alvefur
a03638bd16
mod_storage_sql: Quote some field names
2017-04-12 21:51:17 +02:00
Kim Alvefur
c49d0d5b77
mod_storage_sql: Raise error if encoding check query fails
2017-04-12 17:26:13 +02:00
Kim Alvefur
91baabfede
SQL: Use standard quotes for columns and other identifiers, rewrite to grave accents for MySQL only ( fixes #885 )
2017-04-10 23:13:39 +02:00
Kim Alvefur
32e5f29192
mod_storage_sql: Fix to use correct SQL query (thanks carlos)
2017-04-03 00:34:37 +02:00
Kim Alvefur
9b9d6a9ba9
Merge 0.10->trunk
2017-05-17 01:06:20 +02:00
Kim Alvefur
9548228ec8
Merge 0.10->trunk
2017-04-13 01:30:24 +02:00
Kim Alvefur
a22c6725be
Merge 0.10->trunk
2017-04-12 20:59:18 +02:00
Kim Alvefur
8a9dd05b08
Merge 0.10->trunk
2017-04-10 23:16:13 +02:00