oar-database(1)

πŸ“¦
version 2.5.10 Β· 3 versions
, in ubuntu noble

πŸ’… oar-database(1) β€” the OAR commands girlies know her

okay so bestie, welcome to oar-database, the manual page for managing the OAR database. she's from the OAR commands family and she is, lowkey, the backbone of the whole operation. let's get into it ✨


🌸 NAME 🌸

oar-database β€” manage OAR database. that's it, that's the job, and she ate πŸ’…


✨ SYNOPSIS ✨

like, here's how you summon her:

oar-database --create [OPTIONS]

oar-database --drop [OPTIONS]

oar-database --upgrade [OPTIONS]

oar-database --reset [OPTIONS]

oar-database --check [OPTIONS]

five whole moods. pick one, bestie 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so OAR keeps all its persistent data in a database, and that database is either the MySQL backend or the PostgreSQL backend (check oar.conf for which one you're on, iykyk). and oar-database? she's literally the one you call to manage that database. main character energy fr fr πŸ‘‘


πŸŽ€ ACTIONS πŸŽ€

these are the big five. choose your fighter:

  • --create β€” create an OAR database: inject schema and default data and create users/roles. the full glow-up from nothing ✨
  • --drop β€” drop an existing OAR database and associated users/roles. it's giving... deletion. no cap 😭
  • --upgrade β€” upgrade an existing OAR database. glow-up but make it already existing 🌈
  • --reset β€” reset an existing OAR database to the state of the fresh new one. factory reset but she's a database πŸ’€
  • --check β€” check that OAR database is accessible and up to date (schema version). the vibe check, literally πŸ”

πŸ’– OPTIONS πŸ’–

General parameters 🫢

  • --conf=OAR_CONF_FILE β€” define the OAR configuration file to use. by default /etc/oar/oar.conf is used. and if that file doesn't exist? the default parameters for each value are used. she's flexible like that ✨
  • --update-conf β€” the database parameters given in the command line are written to the OAR_CONF_FILE. so she remembers what you said, periodt πŸ’…
  • -f, --force-sql β€” force to continue the execution even if a SQL command fails. bold move, bestie. she's not gonna stop for anyone πŸ”₯
  • -y, --force-yes β€” force oar-database to continue without prompt even if it could be harmful. no take-backs, no confirmations, just vibes 🚨

Database backend parameters πŸ’œ

these parameters are only required by the --create and --drop actions. the others don't need them, so don't stress 🌸
  • --db-is-local β€” PostgreSQL: use local admin account to execute admin commands. MySQL: use the unix socket connection to execute admin commands. local girl behavior, we love it 🏠
  • --db-admin-user=DB_ADMIN_USER β€” set database backend admin username.
  • --db-admin-pass=DB_ADMIN_PASS β€” set database backend admin password.

OAR database parameters πŸŽ€

if not specified, OAR database parameters are taken from OAR_CONF_FILE. and like, please prefer setting the configurations in that file instead of using these options. i'm just the messenger bestie, she said what she said πŸ™ˆ
  • --db-type=DB_TYPE β€” database backend to use, mysql or Pg (for PostgreSQL). yes, capital P lowercase g, that's not a typo, copy it exactly ✨
  • --db-user=DB_USER β€” set OAR username to access the database. override the one set in OAR_CONF_FILE.
  • --db-pass=DB_PASS β€” set OAR user password to access the database. override the one set in OAR_CONF_FILE.
  • --db-host=DB_HOST β€” set the database backend hostname. override the one set in OAR_CONF_FILE.
  • --db-port=DB_PORT β€” set the database backend TCP port. override the one set in OAR_CONF_FILE.
  • --db-name=DB_NAME β€” set OAR database name. override the one set in OAR_CONF_FILE.
  • --db-ro-user=DB_RO_USER β€” set OAR username for read-only access the database. override the one set in OAR_CONF_FILE.
  • --db-ro-pass=DB_RO_PASS β€” set OAR user password for read-only access the database. override the one set in OAR_CONF_FILE.
  • -d, --debug β€” activate the display of debugging information. she's gonna tell you EVERYTHING πŸ—£οΈ
  • -h, --help β€” display this help. the classic, the icon, the moment πŸ‘‘

🌈 EXAMPLES 🌈

MySQL 🐬

first you need to specify the database parameters in /etc/oar/oar.conf. these parameters will be used by oar-database.

to create a new database (assuming that the MySQL root password is PASS):

oar-database --create --db-admin-user root --db-admin-pass PASS

or if the MySQL server is local and accessible using the unix socket:

oar-database --create --db-is-local

to upgrade an existing database:

oar-database --upgrade

PostgreSQL 🐘

first you need to specify the database parameters in /etc/oar/oar.conf. these parameters will be used by oar-database. if your PostgreSQL database is on the local system, you can use the --db-is-local option which will use PostgreSQL unix account (needs root privileges). yes bestie, root privileges, don't forget πŸ‘€

to create a new database:

oar-database --create --db-is-local

to upgrade an existing database:

oar-database --upgrade

Advanced usages πŸ”₯

to make some tests or to administrate several databases, you can also specify the sql parameters on the command line. for example:

oar-database --create --db-type=Pg --db-host=HOST \
               --db-user=oar --db-pass=PASS \
               --db-admin-user=ADMIN_USER --db-admin-pass=ADMIN_PASS

will create the oar database and the oar user on the postgresql system hosted by HOST. the user ADMIN_USER must have the right to create new databases and new roles on this system. so like, permissions check first, bestie 🫢


🧚 FILES 🧚

  • /usr/lib/oar/database/mysql_structure.sql, /usr/lib/oar/database/pg_structure.sql β€” SQL instructions for creating the structure of the oar database.
  • /usr/lib/oar/database/mysql_default_admission_rules.sql, /usr/lib/oar/database/pg_default_admission_rules.sql β€” SQL instructions for inserting the default admission rules in the oar database.
  • /usr/lib/oar/database/default_data.sql β€” SQL instructions for inserting the default data in the oar database.
  • /usr/lib/oar/database/mysql_reset_structure.sql, /usr/lib/oar/database/pg_reset_structure.sql β€” SQL instruction for emptying an existing oar database.
  • /usr/lib/oar/database/mysql_structure_upgrade_*.sql, /usr/lib/oar/database/pg_structure_upgrade_*.sql β€” SQL instructions for upgrading an existing database.

those * wildcards are doing so much work and honestly, respect 🌟


πŸ‘‘ COPYRIGHTS πŸ‘‘

Copyright 2003-2018 Laboratoire d'Informatique de Grenoble (http://www.liglab.fr). This software is licensed under the GNU General Public License Version 2 or above. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

NO warranty bestie. not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. she said it, i'm just relaying it πŸ’€

and that's the whole page!! this was oar-database from the OAR commands collection, dated 2023-07-10. go manage that database, you absolute icon πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from