flutter_fixtures_sqflite 0.3.1
flutter_fixtures_sqflite: ^0.3.1 copied to clipboard
SQLite/sqflite implementation for Flutter Fixtures - mock database queries with fixture files
Changelog #
0.3.1 #
-
RecorderDatabaseAdapterruns statements through core'sTrafficRecorder.run; its behaviour is unchanged. -
BREAKING: new
StatementDatabaseAdapterbase — the nine sqflite-shaped operations are translated into aSqfliteQuerystatement once, and an adapter implements a singlerun(statement).RealDatabaseAdapter,FixtureDatabaseAdapterandRecorderDatabaseAdapterall extend it;RecorderDatabaseAdapter.inneris now typedStatementDatabaseAdapter. A custom adapter is oneruninstead of nine forwards. -
BREAKING:
FixtureDatabaseAdaptertakes onepipeline(FixturePipeline<SqfliteQuery>) instead ofdataQuery/dataSelector/dataSelectorView/delay. A cancelled pick now throwsFixtureCancelledinstead of silently returning the operation's default; not-found and empty still degrade to the default. -
BREAKING:
SqfliteFixtureSourceis now an alias for core'sFixtureSource<SqfliteQuery>, so its lookup method isresolve(wasfind).SqfliteDataQueryis renamedSqfliteFileFixtureSource— core'sFixtureFileSourcewith the sqflite naming convention — with a deprecated alias kept for one release.
0.3.0 #
-
New
RecorderDatabaseAdapter: a record-and-replay decorator over anyDatabaseAdapter, capturing reads and mutations through core'sTrafficRecorderseam (engine:flutter_fixtures_recorder). A replayedinsertreturns the recorded row id without writing anywhere. Statements are described and encoded lazily, so idle traffic costs nothing. -
SqfliteQueryis now the single statement-identity model: it carries everyDatabaseAdapterfield (arguments, values, modifiers) with two projections —fixtureCandidates(lossy fixture-file names, unchanged for table operations) andrecordingTarget(total canonical JSON for record & replay).SqfliteOperationcovers all eleven operations. -
BREAKING: raw writes and
executenow use their own operation in fixture file names —rawInsert_*,rawUpdate_*,rawDelete_*,execute_*instead of collapsing torawQuery_*. Rename affected fixture files. -
BREAKING:
SqfliteDataQueryimplements the newSqfliteFixtureSourceseam (findreturns aFixtureCollection,datareturns the payload as-is):parseis gone (the wire format lives in core's models), list payloads are no longer wrapped in aresultkey, andmockFolderPathwas removed (usemockFolder).FixtureDatabaseAdapter.dataQueryis typed asSqfliteFixtureSource, and the adapter drives core'sFixtureSelector.servepipeline instead of its own find → parse → select → data loop. Fixture files that wrap rows in a top-levelresultkey keep working. -
BREAKING: the unused
SqfliteOperation.rawExecutevalue was removed; raw statements resolve asrawQueryfixtures, as they always did. -
SqfliteQuery.fixtureCandidatesowns the fixture-file candidate list (identifier first, bare{operation}_{table}fallback), so the naming convention lives in one place. -
RealDatabaseAdapteris covered by a conformance test against an in-memory SQLite database (sqflite_common_ffi).
0.2.0 #
- BREAKING:
FixtureDatabaseAdapter.dataQueryis typed asDataQuery<SqfliteQuery, Map<String, dynamic>>, making the seam substitutable in tests. SqfliteDataQueryaccepts anassetLoader, makingfindtestable without a Flutter asset bundle.- The six write operations share one execute path; inline fixture data no longer bypasses
dataQuery.data.
0.1.2 #
- Align version with sibling implementation packages (dio, ui) for consistency
- No code changes
0.1.0 #
- Initial release
- SQLite/sqflite implementation of DataQuery interface
FixtureDatabaseclass providing sqflite-like API (query,insert,update,delete,rawQuery)SqfliteDataQueryfor loading database fixtures from assetsSqfliteQuerymodel for table-based and raw SQL query matching- Support for operations: query, insert, update, delete
- Compatible with flutter_fixtures_core ^0.1.2