/post/5 Back

Post utility updates

Posted 2026-09-09 23:18:26
Hello, I've just finished another update to the ./db post utility. This file is used for creating all posts on this site. It uses a basic sql program that uses the same API as the posts page, this program takes in a single parameter that being a sql statement, which is then run and outputted to the terminal.

./db simply uses the sql utility to modify the database in a user-api method. This simplifies the way in which posts can be created. The db utility now allows for chaining of commands. The commands available are:
Command Parameters Description
create None Creates a new blank/default post
remove int:ID Removes a post given its ID
edit int:ID, str:param Edits a given parameter of a post, posts have three parameters that being the title, body and date
latest str:param Same as the edit command, but this one does not take in an ID as it assumes the ID of the LATEST post.
list None Simply lists the posts along with their IDs.


Now that you can chain commands its easy to create new posts like so:
./db create latest title latest body

That command will first create a new post, then edit its title and then edit its body, all in one command. This is very useful! Who needs fancy frontends that open your site up to hackers when you could just have a static utility on the backend!