I am looking to implement a sort of 'activity log' table where actions a user does are stored in a sqlite table and then presented to the user so that they can see the latest activity they have done. However, naturally, I don't feel it is necessary to keep every single bit of history, so I am wondering if there is a way to configure the table to start pruning older rows once a maximum set limit is reached.
For example, if the limit is 100, and that's how many rows there currently are in the table, when another action is inserted, the oldest row is automatically removed so that there are always a maximum of 100 rows. Is there a way to configure the sqlite table to do this? Or would I have to run a cron job? I'm pretty new to sqlite so I'm sorry if this is a stupid question haha.
Thanks I appreciate any help you guys can give me.
Clarification Edit: At any given moment, I would like to display the last 100 (for example) actions/events (rows) of the table.