Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 2.39 KB

File metadata and controls

57 lines (46 loc) · 2.39 KB

Changelog

All notable changes to this project will be documented in this file.

[0.0.2] - 2026-02-10

Added

  • Configurable mock creation via NewWithOptions(...) and WithStrictTx().
  • Transaction expectations:
    • ExpectBegin()
    • ExpectCommit()
    • ExpectRollback()
  • Example applications under example/:
    • example/basic for simple read/query flow.
    • example/transaction for transfer flow with transaction handling.

Changed

  • New() and NewWithOptions() 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.md Simple Usage updated to reflect current API and strict transaction behavior.

Fixed

  • Stabilized tests that create multiple mock DB instances in one process.
  • Improved statement/connection behavior consistency for transactional and non-transactional paths.

Testing

  • Expanded unit coverage for connection, statement, mock, transaction, and top-level constructor behavior.
  • Added/updated tests for examples in example/basic and example/transaction.

Documentation

  • Added/updated docstrings across core package files to align with current behavior.

[0.0.1] - 2026-02-10

Added

  • Initial minimal mock SQL driver integration via New() for use with database/sql.
  • Driver and connection implementations supporting:
    • Prepare
    • QueryContext
    • ExecContext
  • 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 use AnyArg() instead.
  • Statement support with Stmt.Exec and Stmt.Query delegating to connection execution paths.

Testing

  • 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.

Documentation

  • Added initial README.md with installation steps and basic usage examples.