On 30/01/2025 14:43 EET Andrea Gabellini via dovecot <dovecot@dovecot.org> wrote:
Hello,
I am using the push_notification_lua plugin and would like to modify my script to write data into a dictionary configured as follows:
dict_server { dict proxy { idle_timeout = 300s name = sql slow_warn = 1s } dict sql { sql_driver = mysql mysql localhost { dbname = xxx password = xxx user = xxx } dict_map "shared/dsync/$user" { sql_table = dsync dict_map_value_field last_event { type = uint } dict_map_key_field userid { value = $user } } } }
I am not very familiar with Lua, and I couldn't find any relevant examples in the documentation or online. Would it be possible to provide a sample code snippet demonstrating how to write to this dictionary using Lua?
Thank you!
There is no API yet to instantiate dict objects in Lua, they have to be provided by the caller.
You can use some Lua MySQL module to update the table.
Aki