Skip to content

Commit 9dc434e

Browse files
committed
Document features of MysqlConnection::establish
database URL may contain GET parameters * `unix_socket` * `ssl_mode`
1 parent a06e025 commit 9dc434e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • diesel/src/mysql/connection

diesel/src/mysql/connection/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ impl Connection for MysqlConnection {
5656
type Backend = Mysql;
5757
type TransactionManager = AnsiTransactionManager;
5858

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

0 commit comments

Comments
 (0)