Skip to content
pubscout

mysql_client_plus

0.2.0, released 8 days ago by dev.sumsg.com

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

$ flutter pub add mysql_client_plus
Source repository

What it does

Provides a pure Dart client for connecting to MySQL and MariaDB databases. It supports connection pooling, prepared statements, transactions, large result set streaming, and TLS connections.

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

Use it when

  • You need to connect a Dart or Flutter application directly to a MySQL or MariaDB database.
  • You require connection pooling and transaction support in a pure Dart SQL client.

Skip it when

  • You need a robust ORM instead of executing raw SQL queries.
  • Your architecture mandates talking to databases exclusively through a backend REST/GraphQL API rather than direct client-side database access.

Strengths

  • Written in pure Dart with support for mobile, desktop, and dart runtimes.
  • Supports connection pooling, prepared statements, and transactions.
  • Handles SSL/TLS connections and multiple authentication plugins like caching_sha2_password.

Weaknesses

  • Directly exposing database connections in client applications can be a security risk if not properly secured.
  • Lacks advanced ORM features, requiring manual query writing and result mapping.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

No native platform steps required, but network security rules and database access permissions must be configured.

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

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_plus.

Works with

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