Skip to content

Database backends

Refgenie keeps asset metadata, genome records and settings in a database: SQLite (the default) or PostgreSQL.

SQLite needs no setup. The first time refgenie runs, it writes a config file that points at a SQLite database in ~/.refgenie/refgenie:

~/.refgenie/refgenie_db_config.yaml
type: sqlite
path: ~/.refgenie/refgenie

Use PostgreSQL for shared servers and for anything that writes from several processes at once. Write the config file yourself:

~/.refgenie/refgenie_db_config.yaml
type: postgresql
name: refgenie
user: refgenie_user
password: your_secure_password
host: localhost
port: 5432

Values can use environment variables, such as password: $POSTGRES_PASSWORD. Refgenie connects with the psycopg driver.

ScenarioBackend
One user on a workstationSQLite
CI or a short-lived environmentSQLite
A shared lab or team databasePostgreSQL
A refgenie server (refgenie serve)PostgreSQL
A cloud deployment with several workersPostgreSQL

Refgenie reads the config file from REFGENIE_DB_CONFIG_PATH, which defaults to $REFGENIE_HOME_PATH/refgenie_db_config.yaml:

Terminal window
export REFGENIE_DB_CONFIG_PATH=/path/to/refgenie_db_config.yaml

refgenie config get shows the settings refgenie is using, including this path, genome_folder and genome_stage_folder.

VariableDefaultDescription
REFGENIE_HOME_PATH~/.refgenieBase directory for refgenie files
REFGENIE_DB_CONFIG_PATH$REFGENIE_HOME_PATH/refgenie_db_config.yamlPath to the database config
REFGENIE_GENOME_FOLDER$REFGENIE_HOME_PATH/genomesDirectory for genome assets
REFGENIE_GENOME_STAGE_FOLDER$REFGENIE_HOME_PATH/archivesDirectory for staged assets
REFGENIE_LOG_LEVELWARNINGLog verbosity