test: added possibility to use MySQL server without SSL (for localhost testing purposes)

This commit is contained in:
Ben Vercammen 2023-03-21 20:36:51 +01:00
parent f51171faa8
commit 5634447337

View file

@ -84,6 +84,8 @@ Future<MariaDbExecutor> _connectToMariaDb(List<String> schemas) async {
}
// Executor for MySQL
// create user 'test'@'localhost' identified by 'test123';
// GRANT ALL PRIVILEGES ON orm_test.* to 'test'@'localhost' WITH GRANT OPTION;
Future<MySqlExecutor> _connectToMySql(List<String> schemas) async {
var connection = await MySQLConnection.createConnection(
databaseName: 'orm_test',
@ -91,7 +93,7 @@ Future<MySqlExecutor> _connectToMySql(List<String> schemas) async {
host: "localhost",
userName: Platform.environment['MYSQL_USERNAME'] ?? 'test',
password: Platform.environment['MYSQL_PASSWORD'] ?? 'test123',
secure: true);
secure: !('false' == Platform.environment['MYSQL_SECURE']));
await connection.connect(timeoutMs: 10000);