Archived
1
0
Fork 0

Add MySQL support (#24)

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2021-04-08 15:18:55 +02:00
commit 9f51c62776
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7
9 changed files with 63 additions and 8 deletions

View file

@ -73,13 +73,29 @@ Don't forget to prefix the channel name with an `@`.
### Database
#### SQLite (default)
Default database driver is SQLite using the `restockbot.db` file.
#### PostgreSQL
To configure a PostgreSQL database, you can use Docker:
```
cp -p docker/environment.example docker/environment
docker-compose -f docker-compose.yml up -d
cp -p docker/postgresql.env.example docker/postgresql.env
docker-compose -f docker-compose-postgresql.yml up -d
```
Then see the configuration section to define the database configuration.
#### MySQL
To configure a MySQL database, you can use Docker:
```
cp -p docker/mysql.env.example docker/mysql.env
docker-compose -f docker-compose-mysql.yml up -d
```
Then see the configuration section to define the database configuration.
@ -130,7 +146,7 @@ Default file is `restockbot.json` in the current directory. The file name can be
Options:
* `database` (optional)
* `type`: driver to use (`postgres`, `sqlite`)
* `type`: driver to use (`sqlite`, `postgres`, `mysql`)
* `dsn`: data source name (see [documentation](https://gorm.io/docs/connecting_to_the_database.html))
* `urls` (optional): list of retailers web pages
* `amazon` (optional)