From 385c2227e79e7c84b49037620fc43daf99eb3169 Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Thu, 13 Aug 2020 02:33:22 -0700 Subject: [PATCH] Add more doc comments for MySQL/PostgreSQL connection URIs Note that Diesel implements its own parser for MySQL connection URIs, so it probably doesn't accept the full range of syntax that would be accepted by MySQL's client libraries, whereas for PostgreSQL, Diesel simply passes the connection string/URI to PostgreSQL's libpq for processing. --- .env.template | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.env.template b/.env.template index e964873..745403c 100644 --- a/.env.template +++ b/.env.template @@ -6,9 +6,16 @@ ## Database URL ## When using SQLite, this is the path to the DB file, default to %DATA_FOLDER%/db.sqlite3 -## When using MySQL, this it is the URL to the DB, including username and password: -## Format: mysql://[user[:password]@]host/database_name # DATABASE_URL=data/db.sqlite3 +## When using MySQL, specify an appropriate connection URI. +## Details: https://docs.diesel.rs/diesel/mysql/struct.MysqlConnection.html +# DATABASE_URL=mysql://user:password@host[:port]/database_name +## When using PostgreSQL, specify an appropriate connection URI (recommended) +## or keyword/value connection string. +## Details: +## - https://docs.diesel.rs/diesel/pg/struct.PgConnection.html +## - https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING +# DATABASE_URL=postgresql://user:password@host[:port]/database_name ## Individual folders, these override %DATA_FOLDER% # RSA_KEY_FILENAME=data/rsa_key