aboutsummaryrefslogtreecommitdiffstats
path: root/man/bolt.toml.5
blob: 15858ff358550f812012a6c633298c8dde824eef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.Dd February 12, 2026
.Dt BOLT.TOML 5
.Os
.Sh NAME
.Nm bolt.toml
.Nd bolt configuration file
.Sh DESCRIPTION
.Nm
is the configuration file for
.Xr bolt 1 .
Bolt searches for this file in the current working directory or any parent
directory until the root of the filesystem.
.Pp
Environment variables take precedence over configuration file settings if
both are set.
.Sh FILE FORMAT
The configuration file uses TOML format with two sections:
.Bl -tag -width Ds
.It Cm [migrations]
Migration-related settings.
.It Cm [database]
Database connection settings.
.El
.Sh MIGRATIONS SECTION
.Bl -tag -width Ds
.It Cm directory_path
The directory where migration scripts are located. Defaults to
.Pa migrations .
This can be a relative path (from the current working directory) or an
absolute path.
.Pp
Environment variable:
.Ev BOLT_MIGRATIONS_DIR_PATH
.It Cm version_style
The migration versioning style.
.Qq timestamp
(default) uses timestamps like
.Li 20240316145038 .
.Qq sequential
uses incrementing integers like
.Li 001 , 002 , 003 .
.Pp
Environment variable:
.Ev BOLT_MIGRATIONS_VERSION_STYLE
.El
.Sh DATABASE SECTION
.Bl -tag -width Ds
.It Cm dsn
The Data Source Name (connection string) for the database. See
.Xr bolt-databases 7
for format details.
.Pp
Environment variable:
.Ev BOLT_DB_DSN
.It Cm driver
The database driver to use. One of:
.Qq postgresql ,
.Qq mysql ,
.Qq mssql ,
or
.Qq sqlite3 .
.Pp
Environment variable:
.Ev BOLT_DB_DRIVER
.It Cm migrations_table
The name of the table used to track applied migrations. Defaults to
.Qq bolt_migrations .
.Pp
Environment variable:
.Ev BOLT_DB_MIGRATIONS_TABLE
.El
.Sh ENVIRONMENT
All configuration options can be set via environment variables. When both
a configuration file setting and environment variable are present, the
environment variable takes precedence.
.Pp
.Bl -column "BOLT_MIGRATIONS_VERSION_STYLE" "migrations.version_style" -offset indent
.It Sy Environment Variable Ta Sy Configuration Key
.It Ev BOLT_MIGRATIONS_DIR_PATH Ta Cm migrations.directory_path
.It Ev BOLT_MIGRATIONS_VERSION_STYLE Ta Cm migrations.version_style
.It Ev BOLT_DB_DSN Ta Cm database.dsn
.It Ev BOLT_DB_DRIVER Ta Cm database.driver
.It Ev BOLT_DB_MIGRATIONS_TABLE Ta Cm database.migrations_table
.El
.Sh EXAMPLES
A complete configuration file:
.Bd -literal -offset indent
[migrations]
directory_path = "migrations"
version_style = "timestamp"

[database]
dsn = "postgresql://user:password@localhost:5432/mydb?sslmode=disable"
driver = "postgresql"
migrations_table = "bolt_migrations"
.Ed
.Pp
Using environment variables:
.Bd -literal -offset indent
export BOLT_DB_DSN="postgresql://user:password@localhost:5432/mydb"
export BOLT_DB_DRIVER="postgresql"
export BOLT_MIGRATIONS_DIR_PATH="db/migrations"
.Ed
.Sh SEE ALSO
.Xr bolt 1 ,
.Xr bolt-databases 7