From db9fa2f00152422cc2bee7529a6353be66e30e67 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sat, 3 Dec 2016 15:51:39 +0100 Subject: [PATCH] Improve docs for connection strings. Some parts of the connection strings might be provided from the environment, such as in the MySQL case. Fix #485. --- pgloader.1 | 5 ++++- pgloader.1.md | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pgloader.1 b/pgloader.1 index 3a98b91..1e37079 100644 --- a/pgloader.1 +++ b/pgloader.1 @@ -1819,11 +1819,14 @@ The \fBdatabase\fR command accepts the following clauses and options: \fIFROM\fR . .IP -Must be a connection URL pointing to a MySQL database\. At the moment only MySQL is supported as a pgloader source\. +Must be a connection URL pointing to a MySQL database\. . .IP If the connection URI contains a table name, then only this table is migrated from MySQL to PostgreSQL\. . +.IP +See the \fBSOURCE CONNECTION STRING\fR section above for details on how to write the connection string\. Environment variables described in \fIhttp://dev\.mysql\.com/doc/refman/5\.0/en/environment\-variables\.html\fR can be used as default values too\. If the user is not provided, then it defaults to \fBUSER\fR environment variable value\. The password can be provided with the environment variable \fBMYSQL_PWD\fR\. The host can be provided with the environment variable \fBMYSQL_HOST\fR and otherwise defaults to \fBlocalhost\fR\. The port can be provided with the environment variable \fBMYSQL_TCP_PORT\fR and otherwise defaults to \fB3306\fR\. +. .IP "\(bu" 4 \fIWITH\fR . diff --git a/pgloader.1.md b/pgloader.1.md index f5c2983..e164999 100644 --- a/pgloader.1.md +++ b/pgloader.1.md @@ -1555,12 +1555,21 @@ The `database` command accepts the following clauses and options: - *FROM* - Must be a connection URL pointing to a MySQL database. At the moment - only MySQL is supported as a pgloader source. + Must be a connection URL pointing to a MySQL database. If the connection URI contains a table name, then only this table is migrated from MySQL to PostgreSQL. + See the `SOURCE CONNECTION STRING` section above for details on how to + write the connection string. Environment variables described in + can + be used as default values too. If the user is not provided, then it + defaults to `USER` environment variable value. The password can be + provided with the environment variable `MYSQL_PWD`. The host can be + provided with the environment variable `MYSQL_HOST` and otherwise + defaults to `localhost`. The port can be provided with the environment + variable `MYSQL_TCP_PORT` and otherwise defaults to `3306`. + - *WITH* When loading from a `MySQL` database, the following options are