laconic_mysql 1.1.0
laconic_mysql: ^1.1.0 copied to clipboard
MySQL driver for the Laconic query builder.
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 - Enhanced Exception Handling - All catch blocks now preserve the original exception
causeandstackTraceinLaconicException
1.0.0 #
Initial release of the MySQL driver for Laconic query builder.
Features #
-
MysqlDriver- MySQL database driver implementingDatabaseDriverinterface- Connection pooling with configurable max connections (default: 10)
- Automatic
?to:p0, :p1, ...parameter placeholder conversion - Transaction support
- Proper connection pool cleanup on close
-
MysqlGrammar- MySQL-specific SQL grammar extendingSqlGrammar- Standard SQL syntax compilation
?placeholder parameter binding
-
MysqlConfig- Configuration class for MySQL connectionshost- Database server host (default:localhost)port- Database server port (default:3306)database- Database name (required)username- Database username (default:root)password- Database password (required)secure- Use secure connection (default:true)
Usage #
import 'package:laconic/laconic.dart';
import 'package:laconic_mysql/laconic_mysql.dart';
final laconic = Laconic(MysqlDriver(MysqlConfig(
database: 'database',
password: 'password',
)));
final users = await laconic.table('users').get();
await laconic.close();
Dependencies #
laconic: ^2.0.0mysql_client: ^0.0.27