Skip to content
pubscout

mysql1

0.23.0, released 3 days ago by an unverified publisher

MySQL and MariaDB database driver for Dart and Flutter

Unverified publisher
$ flutter pub add mysql1
Source repository

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.

  • sqflite

    Pick sqflite if you need local SQLite database storage on mobile instead of a remote MySQL server.

  • drift

    Pick drift for a reactive, type-safe SQLite ORM experience.

Works with

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