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.
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.
- hive_ce_flutter
Flutter extension for Hive database initialization and path management
92Compare - mysql_dart
Native MySQL and MariaDB client written in Dart.
74Compare - hive_flutter
Flutter extension for Hive providing easy initialization and adapters for common types.
50Compare - mysql_client
Native MySQL and MariaDB client written in Dart.
50Compare
Works with
Packages commonly used together with mysql_utils: ones it builds on, ones built on it, and its own family.