GOLF(2gg)
π GOLF(2gg) β bestie edition
okay so this is GOLF, section 2gg, from the Development corner of the manual-verse. Strap in, we're setting up an app and it's gonna be β¨immaculateβ¨.
πΈ NAME πΈ
application-setup β the Golf documentation, specifically the running-application part. this is the "how do i actually get my lil app off the ground" page. iykyk.
π DESCRIPTION π
β¨ INITIALIZE APPLICATION β¨
first things first: your Golf application has to be initialized. no init, no app, periodt. and what does "initialized" even mean? it means you create a whole directory structure, and that structure is owned by the application owner β and the application owner can literally be any Operating System user. whoever you want, bestie. it's giving flexible.
so, to initialize an application called <app name>, while you're logged in as the application owner, you run:
sudo mgrg -i -u $(whoami) <app name>
that's it. that's the whole vibe. π
ποΈ SETUP DATABASE(S) ποΈ
heads up: if your application does not use database(s), you can straight up skip this entire section. no database, no drama, moving on. π¦
okay so for the rest of you with databases β you can set them up any way you see fit. genuinely any way. that includes creating the database objects your app uses, like tables or indexes, whatever you need.
the one thing Golf actually needs to know is the connection parameters. those include database login info, but they can include other stuff too β Golf isn't picky, it just wants the deets.
for each database in use, you gotta provide a database-config-file sitting in the same directory as your Golf source code. that file holds the connection parameters, and those parameters are database-specific β every database does its own thing, respect the differences bestie.
so, for example, if your code has statements like:
run-query @mydb = ...
//or
begin-transaction @sales_db
then you must have files mydb and sales_db present. no file, no connection, no slay. π
for example, a MariaDB config file might look like:
[client]
user=golfuser
password=pwd
database=golfdb
protocol=TCP
host=127.0.0.1
port=3306
or for PostgreSQL:
user=myuser password=mypwd dbname=mydb
see? cute, small, does the job. π
π¨ MAKE APPLICATION π¨
time to compile and link, babes. for an application that doesn't use database(s):
gg -q
and when you do have database(s) in use? say, using the example from above β where mydb is a MariaDB database, sales_db is PostgreSQL, and contacts is SQLite β you'd do:
gg -q --db="mariadb:mydb postgres:sales_db sqlite:contacts"
look at that flag doing the absolute most. π₯
See gg for more options β there's a lot more where that came from.
π START APPLICATION π
rule number one: stop the application first, just in case it was already running. don't be the person who starts a thing twice, it's not the vibe.
then start it. for example:
mgrg -m quit <app name>
mgrg -w 3 <app name>
quit, then go. clean. β¨
See mgrg for more details.
π RUNNING APPLICATION π
you can run your application as a service, as CGI, or as command-line. three flavors, all valid, pick your fighter. π
π SEE ALSO π
- Running application
application-setupCGIcommand-lineservice- See all documentation
okay that's the whole page bestie, you're officially set up and iconic for it. π«Ά
this lil masterpiece was served to you by $VERSION, dated $DATE β and yes, it's still GOLF(2gg) at the bottom, as tradition demands. mwah. π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms