Skip to content

Commit

Permalink
mysql: add more configuration options (getredash#5280)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongjiajie authored Jul 3, 2022
1 parent bdd1244 commit c4bfd4f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions redash/query_runner/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ def configuration_schema(cls):
"passwd": {"type": "string", "title": "Password"},
"db": {"type": "string", "title": "Database name"},
"port": {"type": "number", "default": 3306},
"connect_timeout": {"type": "number", "default": 60, "title": "Connection Timeout"},
"charset": {"type": "string", "default": "utf8"},
"use_unicode": {"type": "boolean", "default": True},
},
"order": ["host", "port", "user", "passwd", "db"],
"order": ["host", "port", "user", "passwd", "db", "connect_timeout", "charset", "use_unicode"],
"required": ["db"],
"secret": ["passwd"],
}
Expand Down Expand Up @@ -108,9 +111,9 @@ def _connection(self):
passwd=self.configuration.get("passwd", ""),
db=self.configuration["db"],
port=self.configuration.get("port", 3306),
charset="utf8",
use_unicode=True,
connect_timeout=60,
charset=self.configuration.get("charset", "utf8"),
use_unicode=self.configuration.get("use_unicode", True),
connect_timeout=self.configuration.get("connect_timeout", 60),
)

ssl_options = self._get_ssl_parameters()
Expand Down

0 comments on commit c4bfd4f

Please sign in to comment.