Summary
Standardize result-set safety across drivers.
Invalid row access and invalid column indexes should produce consistent DBError diagnostics instead of backend-specific behavior or undefined access.
Current behavior
SQLite tracks whether next() produced a row and rejects row() before a successful call.
The MySQL result wrapper does not currently enforce the same state check.
Column access methods rely mostly on native backend behavior and do not provide consistent bounds validation.
Expected behavior
All drivers must follow the same result-set contract:
row() is valid only after next() returns true;
- row access becomes invalid after
next() returns false;
- column indexes must be within
0..cols()-1;
- invalid access must produce a clear
DBError.
Scope
Suggested files
modules/db/src/sqlite/SQLiteDriver.cpp
modules/db/src/mysql/MySQLDriver.cpp
modules/db/include/vix/db/core/Result.hpp
modules/db/tests/sqlite_driver_test.cpp
modules/db/tests/mysql_driver_test.cpp
Acceptance criteria
Non-goals
This issue does not include:
- column lookup by name;
- typed optional getters;
- random-access result sets;
- ORM row mapping.
Suggested labels
scope:db
type:enhancement
tests
help wanted
status:accepted
Summary
Standardize result-set safety across drivers.
Invalid row access and invalid column indexes should produce consistent
DBErrordiagnostics instead of backend-specific behavior or undefined access.Current behavior
SQLite tracks whether
next()produced a row and rejectsrow()before a successful call.The MySQL result wrapper does not currently enforce the same state check.
Column access methods rely mostly on native backend behavior and do not provide consistent bounds validation.
Expected behavior
All drivers must follow the same result-set contract:
row()is valid only afternext()returnstrue;next()returnsfalse;0..cols()-1;DBError.Scope
Suggested files
modules/db/src/sqlite/SQLiteDriver.cppmodules/db/src/mysql/MySQLDriver.cppmodules/db/include/vix/db/core/Result.hppmodules/db/tests/sqlite_driver_test.cppmodules/db/tests/mysql_driver_test.cppAcceptance criteria
row()before the first successfulnext()throwsDBError.row()after result exhaustion throwsDBError.cols()throwsDBError.Non-goals
This issue does not include:
Suggested labels
scope:dbtype:enhancementtestshelp wantedstatus:accepted