Skip to content

test(db): add SQLite driver integration tests #436

Description

@GaspardKirira

Summary

Add integration tests for the SQLite implementation of the Vix DB driver interfaces.

SQLite should become the primary local backend used to validate prepared statements, parameter binding, result reading, transactions, generated identifiers, and connection lifecycle behavior without requiring an external database server.

Current behavior

The SQLite driver implements:

  • database opening;
  • prepared statements;
  • positional parameter binding;
  • query execution;
  • non-query execution;
  • result-set iteration;
  • transaction operations;
  • last inserted row identifiers;
  • BLOB parameters;
  • connection validation.

These behaviors are currently not covered by automated integration tests.

Expected behavior

The DB test suite must create temporary SQLite databases and verify the public behavior exposed through both the low-level driver interfaces and the high-level Database facade.

Tests must clean up all temporary files after execution.

Scope

  • Test opening a temporary SQLite database.
  • Test table creation.
  • Test prepared INSERT statements.
  • Test prepared SELECT statements.
  • Test UPDATE and DELETE affected-row counts.
  • Test NULL values.
  • Test strings, signed integers, doubles, booleans, and BLOBs.
  • Test result-set column counts.
  • Test lastInsertId().
  • Test connection ping().
  • Test the Database::sqlite() facade.
  • Preserve the existing public DB API.

Suggested files

  • modules/db/tests/sqlite_driver_test.cpp
  • modules/db/tests/CMakeLists.txt
  • modules/db/src/sqlite/SQLiteDriver.cpp

Acceptance criteria

  • Tests use isolated temporary database files.
  • Tests do not depend on a database installed outside the SQLite library.
  • All supported SQLite parameter types are covered.
  • Query results are validated row by row.
  • Invalid SQL produces a vix::db::DBError.
  • Temporary files are removed after tests.
  • Tests pass repeatedly without shared state.
  • Existing public APIs remain unchanged.
  • Tests run through CTest.

Non-goals

This issue does not include:

  • SQLite migration SQL generation;
  • connection pool concurrency testing;
  • ORM model testing;
  • SQLite performance benchmarks.

Suggested labels

  • scope:db
  • type:ci
  • tests
  • help wanted
  • status:ready

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededscope:dbDatabase driversstatus:readyIssue is fully specified and ready for implementationtestsTests, CI coverage and validationtype:ciCI, tests, or tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions