Skip to content

Commit

Permalink
Document features of MysqlConnection::establish
Browse files Browse the repository at this point in the history
database URL may contain GET parameters
* `unix_socket`
* `ssl_mode`
  • Loading branch information
p-alik committed Feb 1, 2022
1 parent a06e025 commit 9dc434e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions diesel/src/mysql/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ impl Connection for MysqlConnection {
type Backend = Mysql;
type TransactionManager = AnsiTransactionManager;

/// Establishes a new connection to the MySQL database
/// `database_url` may be enhanced by GET parameters
/// `mysql://[user[:password]@]host/database_name[?unix_socket=socket-path&ssl_mode=SSL_MODE*]`
///
/// * `unix_socket` excepts the path to the unix socket
/// * `ssl_mode` expects a value defined for MySQL client command option `--ssl-mode`
/// See <https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#option_general_ssl-mode>
fn establish(database_url: &str) -> ConnectionResult<Self> {
use crate::result::ConnectionError::CouldntSetupConfiguration;

Expand Down

0 comments on commit 9dc434e

Please sign in to comment.