We use Sequelize for ORM. You could specify your database connection with all Sequelize options.
You could simply use this connection string to specify basic information of the database:
This connection string can be passed to CodiMD using either config.json
or environment variables:
Environment Variables | config.json |
---|---|
CMD_DB_URL | dbURL |
If you want to specify advanced configs for your own database, you could use the db
variable in config.json
.
These configs should follow this pattern:
For example, if you want to test your code with sqlite with in-memory storage:
We highly recommend to use UTF8 for database encoding, or you might find some url leads to not found, see more at https://github.com/hackmdio/codimd/issues/1392.
Take MySQL config as example:
CodiMD
Docs