Skip to content
pubscout

mysql_utils

2.1.14, released 7 weeks ago by dev.sumsg.com

A helper library that makes MySQL database operations simpler using mysql_client_plus.

$ flutter pub add mysql_utils
Source repository

What it does

Wraps mysql_client_plus to provide convenient database utilities like initialization settings, simplified queries, CRUD methods, transaction management, and connection pooling support.

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

Use it when

  • You want a simpler API for performing MySQL queries and CRUD operations in Dart and Flutter.
  • You need transaction support and connection pooling for MySQL databases.

Skip it when

  • You are using a non-MySQL database like PostgreSQL, SQLite, or Firebase.
  • You prefer writing raw SQL queries directly through the underlying driver without helper wrappers.

Strengths

  • Provides intuitive helper methods for insertion, updates, deletions, and multi-table queries.
  • Supports transactions with automatic rollback on exceptions.
  • Supports SSL certificates, connection pooling, and JSON/BLOB types.

Weaknesses

  • Relies entirely on the maintained status of mysql_client_plus.
  • Limited to MySQL databases.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Configure database credentials using MysqlUtilsSettings and manage connections via the singleton instance.

var db = MysqlUtils(
  settings: MysqlUtilsSettings(
    host: '127.0.0.1',
    port: 3306,
    user: 'root',
    password: '',
    db: 'testdb',
  ),
);
var row = await db.getOne(table: 'table', fields: '*');
print(row);
await db.close();

Alternatives

Packages that do the same job and could replace mysql_utils.

Works with

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