platform/packages/orm/angel_orm_mysql
2022-05-16 13:04:21 +08:00
..
example Updated ORM Mysql 2022-05-07 15:23:58 +08:00
lib Fixed failed test cases 2022-05-16 13:04:21 +08:00
test Fixed failed test cases 2022-05-16 13:04:21 +08:00
analysis_options.yaml Updated linter 2021-12-20 12:25:43 +08:00
AUTHORS.md Update orm_mysql 2021-06-18 18:17:13 +08:00
CHANGELOG.md Fixed failed test cases 2022-05-16 13:04:21 +08:00
LICENSE Updated linter 2021-12-20 12:25:43 +08:00
melos_angel3_orm_mysql.iml Added melos 2022-03-19 09:37:28 +08:00
pubspec.yaml Updated ORM Mysql 2022-05-07 15:23:58 +08:00
README.md Fixed failed test cases 2022-05-16 13:04:21 +08:00

Angel3 ORM for MySQL

Pub Version (including pre-releases) Null Safety Gitter License

This package contains the SQL Executor required by Angel3 ORM to work with MySQL and MariaDB respectively. In order to better support the differences in MySQL and MariaDb underlying protocols, two different drives have to be used. For MariaDb 10.2.x, mysql1 driver provides the best results, while mysql_client driver handles MySQL 8.x.x without issues.

  • MariaDbExecutor (beta)
  • MySqlExecutor (beta)

Supported database version

  • MariaDb 10.2.x
  • MySQL 8.x

Note MySQL below version 8.0 and MariaDB below version 10.2 are not supported as Angel3 ORM requires common table expressions (CTE).

Connecting to MariaDB database 10.2.x

    import 'package:mysql1/mysql1.dart';

    var settings = ConnectionSettings(
        host: 'localhost',
        port: 3306,
        db: 'orm_test',
        user: 'Test',
        password: 'Test123*');
    var connection = await MySqlConnection.connect(settings);

    var logger = Logger('orm_mariadb');
    var executor = MariaDbExecutor(connection, logger: logger);

Connecting to MySQL database 8.x

    import 'package:mysql_client/mysql_client.dart';

    var connection = await MySQLConnection.createConnection(
        host: "localhost",
        port: 3306,
        databaseName: "orm_test",
        userName: "test",
        password: "Test123*",
        secure: false);

    var logger = Logger('orm_mysql');
    await connection.connect(timeoutMs: 10000);
    var executor = MySqlExecutor(connection, logger: logger);

Known limitation

  • UTC time is not supported
  • Blob is not supported