dartapi_db 0.0.11
dartapi_db: ^0.0.11 copied to clipboard
A light weight Database helper wrapper for dartapi.
0.0.11 #
- Add
QueryBuilder— fluent SELECT query builder returned bydb.query(table).where(column, {equals, notEquals, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual, like, whereIn, isNull, isNotNull})— rich WHERE conditions (all AND-joined).select(columns)— restrict to specific columns instead ofSELECT *.orderBy(column, {ascending})— multi-column sorting.limit(n)/.offset(n)— offset-based pagination; SQLite emitsLIMIT -1 OFFSET nautomatically.get()→Future<DbResult>— all matching rows.first()→Future<Map<String,dynamic>?>— first row or null.count()→Future<int>— row count (ignores ORDER BY / LIMIT / OFFSET)
- Add
DbParamStyleenum (named/colon/positional) andDartApiDB.paramStylegetter — drivers declare their placeholder style;QueryBuildergenerates correct SQL automatically for all three drivers - Add
DbQueryExtensiononDartApiDB— providesdb.query(table)without circular imports
0.0.10 #
- Add
test/mysql_query_builder_test.dart— regression tests for Bug 1 (MySQLupdate()SET/WHERE parameter collision); validates thatw_prefix correctly isolates WHERE params from SET params
0.0.9 #
- Improve README: add MySQL connection example, improve clarity
0.0.8 #
- Add
DbTransactionabstract class for transaction-scoped query sessions - Add
DartApiDB.transaction<T>(callback)— runs callback in a DB transaction; commits on success, rolls back on exception- PostgreSQL: uses
Pool.runTx()(native transaction session) - MySQL: acquires a dedicated connection via
pool.withConnection()withSTART TRANSACTION/COMMIT/ROLLBACK - SQLite: uses
BEGIN/COMMIT/ROLLBACKon the same connection
- PostgreSQL: uses
- Add
SqliteDatabasedriver — fullDartApiDBimplementation backed bysqlite3 - Add
DbType.sqliteenum value - Add
DbConfig.sqlite(String path)convenience constructor; use':memory:'for in-memory databases - Add
MigrationRunner— Flyway-style SQL migration runner that tracks applied migrations in_dartapi_migrations - Add 19 tests for SQLite and MigrationRunner (no server required)
0.0.7 #
- Add connection pooling for PostgreSQL (via
Pool.withEndpoints) and MySQL (viaMySQLConnectionPool) - Add
PoolConfigclass withmaxConnections,minConnections,connectionTimeout, andidleTimeout - Add optional
poolConfigfield toDbConfig— backward compatible, defaults toPoolConfig()when omitted
0.0.6 #
- Fix
MySqlDatabase.update()parameter collision when the same column appears in both SET and WHERE clauses (WHERE params now usew_prefix internally)
0.0.5 #
- Upgrade Postgres to ^3.5.6 from ^2.6.2
0.0.4 #
- Upgrade Postgres to ^3.5.6 from ^2.6.2
0.0.3 #
- Add Code Doc
0.0.2 #
- Fix Test and Exports.
0.0.1 #
- Initial version.