Merged
Conversation
Provides: - Semi-declarative SQL struct-to-row mapping, similar to Qx JSON - Idiomatic query building using C++ syntax - Easier to use database class that automatically handles connections and thread management - Miscellaneous convenience utilities pertaining to SQL Does not cover all database functions, primarily for use in the most common or more simple use cases. More complex database manipulation should continue use of existing Qt SQL types directly.
Add SQL module
Should probably split this into separate, module specific private namespaces.
Unwraps containing templates into their (primary, if mulitple) inner type, or simply returns T if it is not a template.
Allows easily wrapping existing QStrings in single or double quotes in SQL statements.
Due to unspecified initialization order, the static variables in the stream classes were being initialized before the ones used in IoOpReport to create a proper report. The types are not compatible with constinit, so instead we just moved their initialization to the cpp.
There are now 3 distinct overloads, regardless of the actual type requested: - Get all rows immediately as a list - Get the first (or only) row only - Get an iterable object that can walk all rows If the actual type (i.e. T or T within a container) is not an sql-tied struct, then only the first field in a row/record is checked/retrieved. Also makes the type checking implementation more intuitive.
This allows it to work easily with while() loops, even if empty, just lke QSqlResult, instead of having to use do while().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.