Skip to main content

dox_mysql_native 3.0.0-alpha.4 copy "dox_mysql_native: ^3.0.0-alpha.4" to clipboard
dox_mysql_native: ^3.0.0-alpha.4 copied to clipboard

Fast native MySQL and MariaDB client for Dart, the default MySQL driver of the Dox ORM. Rust (mysql_async) runs the pool and a prepared statement cache. Dart gets typed rows.

dox_mysql_native #

A fast MySQL and MariaDB client for Dart. It is the default MySQL driver of the Dox ORM. Rust (mysql_async) owns the connections. Your code stays in Dart.

Values come back with the same Dart types as with the Dox ORM on mysql_dart, and errors are the same MySQLServerException class.

import 'package:dox_mysql_native/dox_mysql_native.dart';

void main() async {
  MysqlNativePool pool = MysqlNativePool.open(
    host: 'localhost',
    user: 'root',
    password: 'password',
    database: 'app',
  );
  MysqlNativeResult result = await pool.query(
    'SELECT id, name FROM users WHERE id = ?',
    parameters: <Object?>[1],
  );
  print(result.rows);
}

With the Dox ORM you do not add this package. dox_orm depends on it and uses it by default. Set DOX_DB_DRIVER=dart to use the Dart driver.

  • Works with MySQL 8.4 (caching_sha2_password) and MariaDB 11.
  • The build hook downloads a ready-built library when one exists for your system. Else it builds it with cargo (install Rust with rustup).
  • Use dart run, dart test or dart build cli. dart compile exe does not run build hooks.

More: Native MySQL driver.

0
likes
0
points
0
downloads

Publisher

verified publisherdartondox.dev

Weekly Downloads

Fast native MySQL and MariaDB client for Dart, the default MySQL driver of the Dox ORM. Rust (mysql_async) runs the pool and a prepared statement cache. Dart gets typed rows.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

code_assets, crypto, hooks, mysql_dart

More

Packages that depend on dox_mysql_native