laconic_mysql 3.4.0
laconic_mysql: ^3.4.0 copied to clipboard
MySQL driver for the Laconic query builder.
3.4.0 #
Features #
LaconicExceptionfrom driver errors now fillsdriver: 'mysql'andcodewith the MySQL server error code (e.g.1062for a duplicate entry); client-side and protocol errors carry no code.MysqlDriver.driverNameconstant identifies the driver.
3.3.0 #
3.1.0 #
Features #
- Added RSA-encrypted
caching_sha2_passwordauthentication for non-TLS connections. Server public-key retrieval is enabled by default whenuseSslisfalse; callers may pinMysqlConfig.serverPublicKeyand disable retrieval withallowPublicKeyRetrieval: false. - Added
MysqlConfig.allowPublicKeyRetrievalandMysqlConfig.serverPublicKeyfor controlling non-TLS authentication.
Security #
- Non-TLS full authentication now encrypts the password with RSA-OAEP instead of rejecting the connection. TLS remains enabled by default.
- A pinned server public key takes precedence over public-key retrieval, making it possible to authenticate without trusting a key received over the same unencrypted connection.
Tests #
- Added protocol-level TLS tests covering SSL negotiation, credential ordering, certificate trust, host-name validation, opt-in bad-certificate handling, and servers without SSL support.
- Added
caching_sha2_passwordtests for retrieved and pinned RSA keys, disabled key retrieval, malformed keys, and encryption edge cases.
3.0.0 #
Breaking Changes #
- TLS is enabled by default —
MysqlConfig.useSslnow defaults totrue. SetuseSsl: falseonly when connecting to a trusted server that does not support TLS. - Client exceptions are private — the embedded client's
MySQL*Exceptiontypes are no longer exported frompackage:laconic_mysql/laconic_mysql.dart. Driver operations continue to report failures throughLaconicException. - Embedded client API is internal — applications must not import files
below
package:laconic_mysql/src/client/. Those implementation types and names may change without notice.
Features #
- Added
MysqlConfig.useSsl,allowBadCertificates,securityContext,connectTimeout, andcommandTimeout. - Added TLS negotiation with optional custom certificate trust configuration.
- Added support for
caching_sha2_passwordauthentication. - Added packet fragmentation and reassembly for large MySQL payloads.
- Added typed prepared-statement parameters for
bool,int,double,DateTime,Uint8List, andBigInt. - Added decoding for additional binary result types, including dates, unsigned integers, JSON, and binary values.
Reliability #
- Connection pool slots are always released when a query or transaction fails.
- Concurrent pool acquisition now respects
maxConnectionsand serves waiters in order. - Prepared statements are cached per connection with LRU eviction and are invalidated when their connection is removed.
- Added connection and command timeouts, packet sequence validation, and transaction rollback error reporting.
Internal Changes #
- Replaced the external
mysql_clientdependency with an internally maintained pure-Dart implementation. - Reorganized the client into connection, transport, protocol, and result layers.
- Replaced
tuplevalues with Dart 3 records and removed thetupledependency. - Standardized internal type names on the
Mysqlprefix.
2.1.0 #
Features #
update()now returns the number of rows matched by itsWHEREclause. Updating an existing row to its current values returns1, while a missing row returns0.- The maintained MySQL client implementation is embedded as a private
implementation detail, so consumers no longer need a separate
mysql_clientdependency or override. - MySQL exception types are exported from
package:laconic_mysql/laconic_mysql.dartfor driver-specific error handling.
2.0.0 #
1.3.2 #
Bug Fixes #
- Fix connection pool slot leak on query errors — Replaced use of
mysql_client0.0.27'sMySQLConnectionPool.withConnection, which did not return connections when the callback threw. After aboutmaxConnectionsfailed queries the pool could hang forever. Laconic now uses an internal pool that always releases connections infinally(including failed transactions and prepared-statement errors).
Features #
MysqlConfig.maxConnections— Optional pool size (default10, same as before).
1.3.1 #
Changes #
- Refactored
_dateFunction→_dateExpression(column)for consistency with other drivers (no behavioral change)
1.3.0 #
Features #
- New Grammar Methods:
compileTruncate(),compileInsertOrIgnore(),compileUpsert()— supports new core laconic v2.3.0 features - Support for
dateWHERE type:whereDate(),whereTime(),whereDay(),whereMonth(),whereYear()— uses MySQL's nativeDATE(),TIME(),DAY(),MONTH(),YEAR()functions - Support for
existsWHERE type:whereExists()/whereNotExists()— EXISTS subqueries in WHERE and JOIN conditions - Support for
locks:lockForUpdate()compiles toFOR UPDATE;sharedLock()compiles toLOCK IN SHARE MODE - Upsert:
upsert()compiles toINSERT INTO ... ON DUPLICATE KEY UPDATE - Insert Or Ignore:
insertOrIgnore()compiles toINSERT IGNORE INTO
Performance #
- Prepared Statement Caching — Frequently used parameterized queries now reuse cached prepared statements (up to 50), eliminating the PREPARE → DEALLOCATE round-trip on repeated executions
Improvements #
- Alignment with laconic v2.3.0: Compile-time compatibility with new
SqlGrammarabstract methods and updatedcompileSelectsignature
1.2.0 #
Refactoring #
- Improve Transaction Handling - Replace individual connection management with
runZonedfor transaction context isolation - Simplify Query Execution - Refactor query execution into dedicated
_executeQuerymethods with protocol-based selection, remove placeholder conversion duplication
1.1.0 #
Features #
- Implement
compileIncrement()/compileDecrement()- Grammar methods for increment/decrement SQL generation with?placeholders - JoinClause BETWEEN Support - Add
betweenandbetweenColumnstype handling in_compileJoinConditions()
Bug Fixes #
- Fix Transaction Isolation - Use
transactional()method to ensure all queries within a transaction use the same connection - Fix
insertAndGetId()Method - Replace prepared statement with directexecute()call to fix parameter binding issue
1.0.1 #
Bug Fixes #
- Fix
insertAndGetId()Placeholder Conversion - Now properly uses_convertPlaceholders()and_createNamedParams()for parameter binding, previously passed raw SQL with?placeholders to prepared statements - Fix Prepared Statement Leak - Use
try-finallyto ensurestmt.deallocate()is always called even when execution fails - Improved Transaction Error Handling - Rollback failures are now caught and reported alongside the original error instead of silently replacing it
Improvements #
- Grammar Singleton -
MysqlGrammaris now a static singleton instance, avoiding unnecessary allocations on each access
1.0.0 #
Initial release of the MySQL driver for Laconic query builder.
Features #
- MySQL database driver using
mysql_clientpackage with connection pooling (max 10) - Prepared statement support (binary protocol) for parameterized queries
- Text protocol fallback for DDL statements (no parameters)
- Transaction support using
runZonedfor connection isolation - Lazy connection pool initialization
- Auto-increment ID retrieval via
lastInsertId