Documentation
¶
Overview ¶
Package dbdsn reads the DSNs of MySQL/MariaDB and PostgreSQL databases the way their drivers do, for the state components and the data module alike. A DSN holds a password, so no error of this package carries the DSN or any part of it: a parse error of net/url or of a driver quotes the text it could not read, which may be the password itself.
Index ¶
Constants ¶
const ( MySQL = "mysql" // MySQL and MariaDB Postgres = "postgres" )
Drivers.
Variables ¶
This section is empty.
Functions ¶
func Hosts ¶
Hosts lists every host the driver may connect to with the DSN, as the driver itself reads it (PostgreSQL: several hosts, fallbacks, host= parameters, PG* variables); "" stands for a local socket.
func MySQLConfig ¶
MySQLConfig accepts mysql://user:pass@host:port/ (or mariadb://) and the driver's own form (user:pass@tcp(host:port)/). The database in it is ignored. The URL takes the parameters of mysqlParams; any other is an error, so a connection is never made without the TLS it asked for. The driver's form takes the driver's own parameters. DriftGate's connections use the text protocol: no server-side prepared statements, so every value arrives as its text and Com_stmt_execute is left to the application, and no multi-statements.
func PostgresURL ¶
PostgresURL reads a postgres:// (or postgresql://) URL; a URL without a database gets postgres.
Types ¶
This section is empty.