@@ -40,14 +40,38 @@ pub struct Config {
4040}
4141
4242/// Configuration for the MySQL database driver.
43- #[ derive( Debug , Default ) ]
43+ #[ derive( Debug ) ]
4444#[ cfg_attr(
4545 feature = "sqlx-toml" ,
4646 derive( serde:: Deserialize ) ,
4747 serde( default , rename_all = "kebab-case" , deny_unknown_fields)
4848) ]
4949pub struct MySqlConfig {
50- // No fields implemented yet. This key is only used to validate parsing.
50+ /// Whether to enable the `PIPES_AS_CONCAT` connection setting
51+ ///
52+ /// Defaults to `true`.
53+ ///
54+ /// Some MySql databases such as PlanetScale error out with this connection setting
55+ /// so it needs to be set `false` in such cases.
56+ pub pipes_as_concat : bool ,
57+ /// Whether to enable the `NO_ENGINE_SUBSTITUTION` sql_mode setting after connection.
58+ ///
59+ /// Defaults to `true` (`NO_ENGINE_SUBSTITUTION` is passed, forbidding engine substitution.)
60+ ///
61+ /// If not set, if the available storage engine specified by a `CREATE TABLE` is not available,
62+ /// a warning is given and the default storage engine is used instead.
63+ ///
64+ /// <https://mariadb.com/kb/en/sql-mode/>
65+ pub no_engine_substitution : bool ,
66+ }
67+
68+ impl Default for MySqlConfig {
69+ fn default ( ) -> Self {
70+ Self {
71+ pipes_as_concat : true ,
72+ no_engine_substitution : true ,
73+ }
74+ }
5175}
5276
5377/// Configuration for the Postgres database driver.
0 commit comments