mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2026-02-02 17:35:08 +01:00
Add postgres support for socket parameter (#136)
Simplifies connecting to postgres via sockets (https://github.com/amacneil/dbmate/issues/107), and standardize the `socket` parameter across both mysql and postgresql. Closes #107
This commit is contained in:
parent
45a122eb86
commit
ed9e57a4ad
4 changed files with 98 additions and 3 deletions
|
|
@ -127,7 +127,7 @@ protocol://username:password@host:port/database_name?options
|
|||
DATABASE_URL="mysql://username:password@127.0.0.1:3306/database_name"
|
||||
```
|
||||
|
||||
A socket parameter can be specified to connect through a unix socket file:
|
||||
A `socket` parameter can be specified to connect through a unix socket:
|
||||
|
||||
```sh
|
||||
DATABASE_URL="mysql://username:password@/database_name?socket=/var/run/mysqld/mysqld.sock"
|
||||
|
|
@ -141,6 +141,12 @@ When connecting to Postgres, you may need to add the `sslmode=disable` option to
|
|||
DATABASE_URL="postgres://username:password@127.0.0.1:5432/database_name?sslmode=disable"
|
||||
```
|
||||
|
||||
A `socket` or `host` parameter can be specified to connect through a unix socket (note: specify the directory only):
|
||||
|
||||
```sh
|
||||
DATABASE_URL="postgres://username:password@/database_name?socket=/var/run/postgresql"
|
||||
```
|
||||
|
||||
**SQLite**
|
||||
|
||||
SQLite databases are stored on the filesystem, so you do not need to specify a host. By default, files are relative to the current directory. For example, the following will create a database at `./db/database_name.sqlite3`:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue