Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 22:20:26 +0200] rev 13151
util.sqlite3: Don't cache prepared statements for one-off queries
The :execute method is mainly used for one-off queries such as creating
tables and indices. There is no need to cache this prepared statement,
as those queries are only done on startup.
Further, prepared statements can't be reused without being reset, so
this was likely broken anyway.
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 22:02:15 +0200] rev 13150
util.sqlite3: Deduplicate query methods
There were 3 very similar methods:
- :execute()
- :execute_query()
- :execute_update()
The first one returns the prepared statement and is mainly used
internally in the library for CREATE statements.
The later two only really differ in how the results are returned.
Those two are one main method and one small one that only picks out the
iterator.
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 22:00:43 +0200] rev 13149
util.sqlite3: Fix indentation
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 16:39:48 +0200] rev 13148
mod_storage_sql: Compose a keyval+ store out of keyval and map store methods
Removes the need for the shim in storagemanager.
The methods only really access the 'store' property of the first (self)
argument, so this is safe.
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 15:44:09 +0200] rev 13147
mod_storage_sql: Add UPSERT support
Currently limited to SQLite3 for lack of testing on other databases.
Adds a migration to replace the non-UNIQUE prosody_index, renaming it
prosody_unique_index since ALTER INDEX does not seem to be portable.
Kim Alvefur <zash@zash.se> [Thu, 08 Jun 2023 09:37:01 +0200] rev 13146
tools: Update imports to use new prosody.* namespace
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 13:06:05 +0200] rev 13145
Merge 0.12->trunk
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 12:18:09 +0200] rev 13144
mod_http: Simplify conversion of Set to Array
Avoids the _items semi-private value, that is used everywhere for some
reason.
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 12:33:58 +0200] rev 13143
mod_http: Fix error if 'access_control_allow_origins' is set
Because it changes the type of the 'opt_origins' variable from util.set
to the internal _items table so next time an http app is added an error
"attempt to call a nil value (method 'empty')" is triggered. The value
is not used anywhere else.
Noticed when reviewing uses of the '_items' set property.
Not reported by any users, implying this setting is rarely used.
Kim Alvefur <zash@zash.se> [Sat, 10 Jun 2023 12:14:12 +0200] rev 13142
util.array: Expose new() on module table
For consistency with other utils.
Consistency is good.