drivers/mysql library Independent SQL drivers
MySQL connections for raw SQL and typed ORM sessions.
Each driver owns one physical connection and queues entire connection leases, so another caller cannot enter an active transaction.
Classes
- AcquisitionOptions
- Limits waiting for a connection, including establishment and initialization. Cancellation after acquisition does not cancel the session callback.
- Backend
- Static engine identity used to constrain driver and transaction APIs.
- CancellationToken
- A cancellation request. Await the operation itself to observe its actual database outcome; completion can win a race with cancellation.
- Capabilities Independent SQL drivers
- Features a concrete driver can execute for its actual engine and platform.
-
Codec<
T> - Converts a typed Dart value to database storage and decodes it on reads.
- Codecs
- Built-in conversions for SQL scalar values, JSON, and exact numeric types.
- Decimal
- A finite base-ten value, independent of binary floating point.
-
Driver<
B extends Backend> Independent SQL drivers -
Owns or borrows connection resources for a specific engine
B. - ExecutionOptions
- Per-operation connection acquisition and statement execution controls.
- LocalDate
- A Gregorian calendar date, without a time or timezone. Year 0 is 1 BC; negative years use astronomical numbering.
- LocalDateTime
- Calendar date and wall-clock time, with no timezone or implied UTC instant.
- LocalTime
- A wall-clock time at microsecond resolution, including the endpoint 24:00. The fourth constructor argument is the full fractional second (0..999999).
- Mariadb
- Type marker for MariaDB drivers and sessions.
- Mysql
- Type marker for MySQL drivers and sessions.
- MysqlDriver
- One physical connection. Whole leases are queued, including transactions. Create additional drivers explicitly when independent concurrent leases are required. Closing drains all leases accepted before close was called.
- MysqlOptions
- Configuration for one owned MySQL connection.
- Postgres
- Type marker for PostgreSQL drivers and sessions.
- SqlCommand
- SQL text and separately bound values. Values are never interpolated into SQL.
- SqlConnection Independent SQL drivers
- Execution port for one physical connection during an active driver lease.
- SqlCursor
- Bounded row retrieval tied to the connection lease that opened it.
- Sqlite
- Type marker for native and browser SQLite drivers and sessions.
- SqlJson
- A non-SQL-null JSON document. Its value may itself be JSON null. Drivers use this envelope for parsed JSON, including JSON string scalars.
- SqlReal
- Explicit floating-point SQL input. JavaScript cannot distinguish an integral double from int by runtime type; this preserves the SQL intention.
- SqlResult
- Raw row values and write metadata returned by a completed driver operation.
Enums
- DecimalRounding
- Rounding is explicit; exact rejects a non-zero discarded remainder.
- MysqlTls
- Transport encryption and server identity checks for MySQL and MariaDB.
- SqlDialect
- SQL engine used for quoting, parameter syntax, and capability validation.
Extensions
- InstantPrecision on DateTime
- Explicit precision conversion for resolved UTC instants.
Exceptions / Errors
- MysqlFailure
- A server-reported error. Numeric codes are preserved; SQLSTATE is not exposed by mysql_client_plus and is not guessed from the error message.
- OrmException
- An ORM failure with a stable machine-readable code and optional cause.
- SqlFailure
- Adapter classification. Retrying also requires a confirmed rollback and an explicitly repeatable application callback; these flags alone are not enough.