Database
Database configuration variables for the Crow CI server.
DATABASE_DRIVER
Section titled “DATABASE_DRIVER”- Name:
CROW_DATABASE_DRIVER - Description: Database driver.
- Default:
sqlite3
DATABASE_DATASOURCE
Section titled “DATABASE_DATASOURCE”- Name:
CROW_DATABASE_DATASOURCE - Description: Database driver configuration string.
- Default:
/var/lib/crow/crow.sqlite, or uses an existing file if found in this order:crow.sqlite(current directory)woodpecker.sqlite(current directory)/var/lib/crow/crow.sqlite/var/lib/woodpecker/woodpecker.sqlite
DATABASE_SCHEMA
Section titled “DATABASE_SCHEMA”- Name:
CROW_DATABASE_SCHEMA - Description: Database schema name.
This allows running Crow in a specific PostgreSQL schema instead of the default
publicschema. - Default: none (uses database default, typically
publicfor PostgreSQL) - Note: Only supported for PostgreSQL. Setting this for other database drivers will result in an error.
Connection pool
Section titled “Connection pool”For PostgreSQL and MySQL, the server keeps a pool of up to CROW_DATABASE_MAX_CONNECTIONS connections and reuses them.
By default an idle connection is closed after 5 minutes and every connection is replaced after 30 minutes.
SQLite always uses a single connection, and these settings don’t apply to it.
The pool statistics are exported on the /metrics endpoint as go_sql_* metrics.
A rising go_sql_wait_count_total means requests wait for a free connection, so the pool is too small.
DATABASE_MAX_CONNECTIONS
Section titled “DATABASE_MAX_CONNECTIONS”- Name:
CROW_DATABASE_MAX_CONNECTIONS - Description: Maximum number of open connections to the database.
- Default:
100
DATABASE_IDLE_CONNECTIONS
Section titled “DATABASE_IDLE_CONNECTIONS”- Name:
CROW_DATABASE_IDLE_CONNECTIONS - Description: Maximum number of idle connections kept in the pool. A connection above this number is closed as soon as it is returned, so the next burst has to open it again.
- Default: the value of
CROW_DATABASE_MAX_CONNECTIONS
DATABASE_CONNECTION_MAX_LIFETIME
Section titled “DATABASE_CONNECTION_MAX_LIFETIME”- Name:
CROW_DATABASE_CONNECTION_MAX_LIFETIME - Description: Maximum time a connection may be reused, busy or idle, before it is closed and replaced.
0keeps connections forever. - Default:
30m - Note: Replaces
CROW_DATABASE_CONNECTION_TIMEOUT, which still works as a deprecated alias and logs a warning. Earlier releases defaulted it to3s, which reopened every connection every three seconds.
DATABASE_CONNECTION_MAX_IDLE_TIME
Section titled “DATABASE_CONNECTION_MAX_IDLE_TIME”- Name:
CROW_DATABASE_CONNECTION_MAX_IDLE_TIME - Description: Maximum time a connection may stay idle before it is closed.
This lets the pool shrink again after a burst.
0keeps idle connections until their lifetime ends. - Default:
5m
DATABASE_LOG
Section titled “DATABASE_LOG”- Name:
CROW_DATABASE_LOG - Description: Enable logging in database engine (currently xorm).
- Default:
false
DATABASE_LOG_SQL
Section titled “DATABASE_LOG_SQL”- Name:
CROW_DATABASE_LOG_SQL - Description: Enable logging of SQL commands.
- Default:
false