Re: Storing Last Login Plugin value in SQL

2021-09-13 Thread Gedalya
On 9/14/21 05:44, dove...@ptld.com wrote: > > Thank you for the solution of using sql triggers. I was able to get it > working that way. > I hope it doesn't add too much overhead as it feels like a band-aid and > duct-tape fix. Yes, it's a workaround rather than being able to customize the SQL q

Re: Storing Last Login Plugin value in SQL

2021-09-13 Thread Gedalya
On 9/14/21 02:25, dove...@ptld.com wrote: > > The problem im having with the last-login plugin is the only option i can see > to use is a dict map{}. I can not create my own query for the plugin to > execute otherwise this would be way easier. Using the map{} method all you > can do it tell it t

Re: Storing Last Login Plugin value in SQL

2021-09-13 Thread Gedalya
On 9/14/21 02:12, dove...@ptld.com wrote: > > Anyone have any idea how to get the last-login plugin to update a date/time > column in sql? I use this to throttle updates to once in 900 seconds: create trigger tg1 before update on mailacct for each row if new.lastlogin < (old.lastlogin + 900) th

Re: Storing Last Login Plugin value in SQL

2021-09-13 Thread dovecot
Assuming you use MariaDB / MySQL, you create this trigger in the database. Assuming your int/bigint/varchar column is lastlogin and the table name is mailacct, the trigger will update the datetime `logindate` column whenever the table is updated, by whatever existing queries you have. This is yo

Re: Storing Last Login Plugin value in SQL

2021-09-13 Thread dovecot
On 09-13-2021 2:20 pm, Gedalya wrote: On 9/14/21 02:12, dove...@ptld.com wrote: Anyone have any idea how to get the last-login plugin to update a date/time column in sql? I use this to throttle updates to once in 900 seconds: create trigger tg1 before update on mailacct for each row if new.l

Storing Last Login Plugin value in SQL

2021-09-13 Thread dovecot
The last-login plugin sends a number (epoch seconds) as uint or string in a query to sql. If i create a column type in sql of varchar() the number is saved in the column as a string, but not very useful. I can not figure out how to get that value into a date/time column such as date, datetime