@bot@kroner@meso you could pretty easily write a pleroma specific language that tells you things about the pleroma database, but why do that when you have a language that tells you things about any database?
@errante@bot@kroner yeah, and it's very specific. Pleroma doesn't have a database of its own it uses a general-purpose database where you can store anything. probably the naming is the only confusing thing - tables, rows, etc. you store rows which have multiple columns in them inside tables.
SQL is actually one of the most human-like languages in programming. you literally query the database to "select bot FROM users" for example to fetch the bot user.
the SQL query there is actually a bit complicated, but that's because you have to learn the language to understand what it does. I don't, but from what I can tell it selects u.nickname and uu.nickname (the nickname of u and uu, the dot is to fetch that from them) from the user_relationships table. then it does some stuff to select specifically the block relationship type (which is "1" i think)
@bot@meso@errante@kroner the sql statement in there is about as close to doing that as you can get with computer stuff without it becoming obnoxious in other ways
a programming language that just tries to resemble english language as much as possible is applescript: https://rosettacode.org/wiki/100_doors#AppleScript and i can tell you that in a lot of cases it's just obnoxious to write. "am i phrasing this in the exact way it needs to be phrased??"
the sql statement is kind of extra annoying because the way pleroma stores its idea of users, relationships between users, and of a relationship being a 'block' is kind of dumb, but the way it stores the ideas of posts and "a post being private" is really really really dumb so code that does "show me all of bot's private posts" would be a mess
if anything that code is unusually /readable/ because it is just "show me everyone who blocked errante" instead of something like "please open a list of all users and then retrieve the user who goes by errante and remember than and then look at each user inividually and then tell me the list of everyone that user has blocked and then check to see if errante is in that list and if errante is in that list then tell me the name of that user and then if there is a problem doing any of that then don't bother me with that information but just look at the next user, and also if that all went ok then go to the next user too"
@meso@errante@bot@kroner For what it’s worth, you can run any file marked as executable on your system, whether it’s in $PATH or not, by simply providing the full path to the file in the terminal. I. E. putting “/home/your-user/Downloads/blocks.sh bot” in the terminal without anything else, will run it the same as if you ran “./blocks.sh bot” from within the Downloads folder
@errante@bot@kroner the $1 is the first argument that is called when you run the script btw
if you place the script in a file called blocks.sh, you will run it like "blocks.sh bot" (and preface it with ./ to indicate the file is in the current directory, because normally Linux runs binaries from the /usr/bin or /usr/local/bin directories if they are present there, this just ensures it runs the local file rather than the installed binaries)
the "bot" (or any other string of text) is the argument, and you refer to it with $1 inside the script