Purge Rows by Values

Something I do and have seen others do as well is make db rows and identify a row based on Server ID which is awesome if the bot is still in the server but when the bot leaves the server you have to manually add a Delete Rows by Value for every db unless you want to store the data for the server the bot is no longer in. My suggestion is simple, Add a block labelled, “Purge Rows by Values”. This block will have an expandable menu like the Advanced Conditional where you can select as many databases as you want to ignore and when the block executes, you can select up to 5 columns to select as filters with different conditionals (given the columns in each db share a name (ie: server_id, channel_id, user_id)) and it would delete all rows across all databases that are not selected that match the selected values

This is to replace things like the following image which is large and messy

2 Likes

Basically a block that does this and deletes any row that matches the thing in the lookup. You can put up to 3 column names to look for like for example if the entered value was a server id, you could put server_id, guild_id or server and it would look for one of those in every db and delete any rows matching at least one of the selected terms

I feel like this could be done pretty easily with a custom block, and most people keep server settings within a single db

It can be done in a custom block but is annoying and gets to be a lot when there are more than 20 dbs

While server settings can be in a single db, there are a lot of cases where you have more than just server settings stored like if you have a db for AI, starboard, join/leave logs, welcomer, invites, giveaways, modmail or any other number of other features, it would be nice to have a block that combs all databases and deletes every row that matches the delete row/value

Can’t it be done with an iterator?

  • Split String Iterator (delimiter = , and string is comma separated list of dbs)
    • Delete Rows by Values (delete server ID in db of Split String Iterator - String)

Potentially but idk if it works like that or if that will have any adverse effects later on within Inventor