All notable changes to this project will be documented in this file.
- Configurable mock creation via
NewWithOptions(...)andWithStrictTx(). - Transaction expectations:
ExpectBegin()ExpectCommit()ExpectRollback()
- Example applications under
example/:example/basicfor simple read/query flow.example/transactionfor transfer flow with transaction handling.
New()andNewWithOptions()now register unique driver names per call, allowing repeated and parallel creation without driver registration panic.- Strict transaction mode now enforces query/exec to run only within an active transaction with clearer error messages.
README.mdSimple Usage updated to reflect current API and strict transaction behavior.
- Stabilized tests that create multiple mock DB instances in one process.
- Improved statement/connection behavior consistency for transactional and non-transactional paths.
- Expanded unit coverage for connection, statement, mock, transaction, and top-level constructor behavior.
- Added/updated tests for examples in
example/basicandexample/transaction.
- Added/updated docstrings across core package files to align with current behavior.
- Initial minimal mock SQL driver integration via
New()for use withdatabase/sql. - Driver and connection implementations supporting:
PrepareQueryContextExecContext
- Expectation API:
ExpectQuery(...).WithArgs(...).WillReturnRows(...)ExpectExec(...).WithArgs(...).WillReturnResult(...)ExpectationsWereMet()to verify all expectations are fulfilled.
- In-memory rows helper via
NewRows(...).AddRow(...). - Argument matchers:
AnyArg()for wildcard argument matching.AnyArgOf[T]()for type-based wildcard matching.- Explicit panic guard for
AnyArgOf[any]()with guidance to useAnyArg()instead.
- Statement support with
Stmt.ExecandStmt.Querydelegating to connection execution paths.
- Added unit tests covering core execution paths, expectation matching, argument matchers, and statement delegation.
- Test cases include success scenarios, mismatch failures, and matcher misuse panic validation.
- Added initial
README.mdwith installation steps and basic usage examples.