Skip to content

Core, DB: Introduce xi_unit_test, various improvements to db layer - #11076

Open
zach2good wants to merge 22 commits into
basefrom
db_layer_improvements
Open

Core, DB: Introduce xi_unit_test, various improvements to db layer#11076
zach2good wants to merge 22 commits into
basefrom
db_layer_improvements

Conversation

@zach2good

Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Review commit-by-commit, if you so please.

  • Expands handled types
  • Expands db API
  • Adds compile-time checking of queries
  • Reduces allocations for all things db related
  • Even more security around transactions
  • Removes the shared_ptr hack for blob handling inside db layer
  • Lots of unit tests
  • Moves C++-only unit tests into it's own exe
  • Run that exe alongside the build, so we can fail sooner if something is majorly wrong (these run fast anyway)

Not retrying the failed statement still leaves the statements after it to run, one by one, on a fresh auto-committing connection.
MySQL has no nested transactions: a second START TRANSACTION commits the outer one, losing its atomicity exactly where the inner call meant to protect it.
xi_test boots a server and talks to a live database to run the Lua suite; the Catch2 tests need neither, and rode along at the cost of a ten-minute build and a nine-minute run.
Carrying on past a failed statement means the COMMIT keeps every statement around the one that failed, which is the opposite of what the caller asked for.
The C++ unit tests used to ride along inside xi_test's startup; splitting them into their own binary took them out of CI until something ran it.
The tests need nothing the build job does not already have, so every configuration in the matrix can gate on them instead of waiting for the test workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant