Skip to content
pubscout

mysql_client

0.0.27, released 4 years ago by an unverified publisher

Native MySQL and MariaDB client written in Dart.

Unverified publisher
$ flutter pub add mysql_client
Source repository

What it does

Allows Dart and Flutter applications to connect directly to MySQL and MariaDB servers. It provides connection pooling, transactions, prepared statements, TLS support, and typed data access.

AI-written summary of version 0.0.27, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to connect a Dart or Flutter app directly to a MySQL or MariaDB database.
  • You require features like connection pooling, transactions, and prepared statements.

Skip it when

  • You prefer communicating with your database through a secure REST or GraphQL backend API rather than directly from the client.
  • You are using a non-MySQL compatible database system.

Strengths

  • Native Dart implementation with no external C/C++ bindings required.
  • Supports connection pooling, transactions, and real prepared statements.
  • Supports TLS/SSL connections and multiple authentication methods.

Weaknesses

  • Exposing direct database credentials in a client-side Flutter application is generally a security risk unless used for server-side Dart.
  • Limited to MySQL and MariaDB.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Not documented

final pool = MySQLConnectionPool(
  host: '127.0.0.1',
  port: 3306,
  userName: 'your_user',
  password: 'your_password',
  maxConnections: 10,
);

var result = await pool.execute("SELECT * FROM book WHERE id = :id", {"id": 1});
for (final row in result.rows) {
  print(row.assoc());
}

Alternatives

Packages that do the same job and could replace mysql_client.

  • mysql_client_plus

    Native MySQL client written in Dart with connection pooling, transactions, and TLS support.

  • mysql_dart

    Native MySQL and MariaDB client written in Dart.

  • mysql1

    MySQL and MariaDB database driver for Dart and Flutter

  • powersync

    PowerSync Dart and Flutter SDK. Sync Postgres, MongoDB, MySQL or SQL Server with SQLite in your app

Works with

Packages commonly used together with mysql_client: ones it builds on, ones built on it, and its own family.