Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.

Commit 11fb695

Browse files
authored
More info on sql::query in the README
1 parent 56e8dc9 commit 11fb695

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ The `sql::schema` class template represents relational schemas and, when instant
1717

1818
## Class Template: `sql::query`
1919

20-
The [`sql::query`](https://github.com/mkitzan/metaprogramming-optimization/blob/master/include/sql/query.hpp) class template is the user interface to the SQL query parser. The class is templated on a `cexpr::string` the SQL query and a variadic number of `sql::schema` types. The contructor to a fully specified `sql::query` class takes a variadic pack of `sql::schema` objects which it uses to seed the relational algebra expression tree with iterators to data. The `sql::query` object can then be used in a range loop and structured binding declaration like in [this example](https://github.com/mkitzan/metaprogramming-optimization/blob/master/resources/sql/table_test.cpp#L46). The relational algebra expression tree uses static members to hold data, so only one object of a single fully specicified `sql::query` class can exist at once in the program. To ensure this the object should be constructed within the range loop specification like in [the example](https://github.com/mkitzan/metaprogramming-optimization/blob/master/resources/sql/table_test.cpp#L46).
20+
The [`sql::query`](https://github.com/mkitzan/metaprogramming-optimization/blob/master/include/sql/query.hpp) class template is the user interface to the SQL query parser. The class is templated on a `cexpr::string` the SQL query and a variadic number of `sql::schema` types. The contructor to a fully specified `sql::query` class takes a variadic pack of `sql::schema` objects which it uses to seed the relational algebra expression tree with iterators to data. The `sql::query` object can then be used in a range loop and structured binding declaration like in [this example](https://github.com/mkitzan/metaprogramming-optimization/blob/master/resources/sql/table_test.cpp#L46). The relational algebra expression tree uses static members to hold data, so only one object of a single fully specicified `sql::query` class can exist at once in the program. To ensure this the object should be constructed within the range loop specification like in [the example](https://github.com/mkitzan/metaprogramming-optimization/blob/master/resources/sql/table_test.cpp#L46). It's worth noting that even though this class template's source file is the largest among the code base, nearly all of it is only live during compilation to parse the SQL query `cexpr::string`. In fact, the [runtime interface](https://github.com/mkitzan/metaprogramming-optimization/blob/master/include/sql/query.hpp#L474) is deliberately insubstantial, merely providing an wrapper to support range loops and structured binding declarations. In compliance with range loop syntax, `sql::query` has an associated iterator class [`sql::query_iterator`](https://github.com/mkitzan/metaprogramming-optimization/blob/master/include/sql/query.hpp#L127). `sql::query_iterator` wraps the type representing the relational algebra expression and handles all of the idiosyncrasies of its usage in favor of the familar [`forward iterator`](https://en.cppreference.com/w/cpp/named_req/ForwardIterator) interface.
21+
2122

2223
## Class Template: `sql::row`
2324

0 commit comments

Comments
 (0)