mysql1
0.23.0, released 3 days ago by an unverified publisher
MySQL and MariaDB database driver for Dart and Flutter
Unverified publisher
What it does
A library for connecting to and querying MySQL and MariaDB databases. It allows executing queries with parameters, handling results, inserting, updating data, and running multi-statement queries.
AI-written summary of version 0.23.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 want client-side parameter binding and SQL execution similar to package:postgres
Skip it when
- You are building for Flutter Web, as sockets are not supported on the web platform
- You prefer an ORM or a declarative database builder like drift
Strengths
- Keeps behavior and defaults close to major MySQL drivers and package:postgres
- Supports connection settings, parameterized queries, and batch multi-queries
Weaknesses
- Does not work on Flutter Web due to socket limitations
- DECIMAL values are read as Strings, requiring manual parsing or third-party types for math
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Not documented
var settings = new ConnectionSettings(host: 'localhost', port: 3306, user: 'bob', password: 'wibble', db: 'mydb');
var conn = await MySqlConnection.connect(settings);
var results = await conn.query('select name, email from users where id = ?', [1]);Alternatives
Packages that do the same job and could replace mysql1.
Works with
Packages commonly used together with mysql1: ones it builds on, ones built on it, and its own family.
- cryptomysql1 depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- poolmysql1 depends on itManage a finite pool of resources to control concurrent operations.
- loggingmysql1 depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- bones_apiBuilt on mysql1A powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.
- typed_sqlBuilt on mysql1Type-safe SQL queries and schema definitions using code generation.