woodpecker/docs/setup/sqlite.md

35 lines
1.4 KiB
Markdown
Raw Normal View History

2015-07-07 04:13:50 +00:00
# SQLite
Drone uses SQLite as the default database with zero configuration required. In order to customize the SQLite database configuration you should specify the following environment variables:
2015-07-07 04:13:50 +00:00
2015-08-09 03:51:12 +00:00
```bash
DATABASE_DRIVER="sqlite3"
2015-08-09 03:51:12 +00:00
DATABASE_CONFIG="/var/lib/drone/drone.sqlite"
2015-07-07 04:13:50 +00:00
```
2015-08-09 03:51:12 +00:00
## Sqlite3 configuration
2015-08-10 03:18:21 +00:00
The following is the standard URI connection scheme:
```
file:path[?options]
```
The components of the datasource connection string are:
2015-07-07 04:13:50 +00:00
2015-08-10 03:18:21 +00:00
* `file:` URI prefix to identify database files.
* `path` local path to the database file. The default value is `/var/lib/drone/drone.sqlite`.
* `?options` connection specific options. **not recommended**
2015-07-07 04:13:50 +00:00
2015-08-10 03:18:21 +00:00
## Sqlite3 options
2015-07-07 04:13:50 +00:00
2015-08-10 03:18:21 +00:00
This section lists all connection options used in the connection string format. Connection options are pairs in the following form: `name=value`. The value is always case sensitive. Separate options with the ampersand (i.e. &) character:
* `vfs` opens the database connection using the VFS value.
* `mode` opens the database as `ro`, `rw`, `rwc` or `memory`.
* `cache` opens the database with `shared` or `private` cache.
* `psow` overrides the powersafe overwrite property of the database file being opened.
* `_loc` sets the location of the time format. Use `auto` to auto-detect.
* `_busy_timeout` sets the value of the `sqlite3_busy_timeout`
* `_txlock` sets the locking behavior to `immediate`, `deferred`, or `exclusive`