How do I add a new country?

Table of Contents

Add a new country via ores.cli. See the CLI inventory for sibling recipes.

Question

How do I add a new country using ores.cli?

Answer

Using .env

set -a && source .env && set +a
./ores.cli refdata countries add \
  --tenant "$ORES_TENANT" \
  --alpha2-code "XX" \
  --alpha3-code "XXX" \
  --name "Test Country" \
  --numeric-code "999" \
  --official-name "The Republic of Test Country" \
  --modified-by super_admin \
  --change-reason-code "system.new_record" \
  --change-commentary "Adding test country via CLI"
Successfully added country: XX

With explicit db args

./ores.cli refdata countries add \
  --db-user ores_prime_origin_cli_user \
  --db-password "$ORES_CLI_DB_PASSWORD" \
  --db-database ores_dev_prime_origin \
  --tenant "$ORES_TENANT" \
  --alpha2-code "XX" \
  --alpha3-code "XXX" \
  --name "Test Country" \
  --numeric-code "999" \
  --official-name "The Republic of Test Country" \
  --modified-by super_admin \
  --change-reason-code "system.new_record" \
  --change-commentary "Adding test country via CLI"

Notes

  • --modified-by must be a valid account username or service role in the database; it is validated by ores_iam_validate_account_username_fn.
  • --tenant accepts a tenant UUID. The ORES_TENANT variable in .env (if present) is picked up automatically when the env is sourced.

Emacs 29.3 (Org mode 9.6.15)