Skip to content

Conversation

trueqbit
Copy link
Collaborator

SQLite features Hidden columns in virtual tables, which then can be used as Table-valued functions.

This PR brings:

  • Table references for C++17 in order to facilitate table-valued expressions.
  • Support for eponymous virtual tables with hidden columns.
  • Support for eponymous virtual tables with hidden columns as table-valued functions.
  • Support for the "generate_series" extension.

Additionally:

  • Unit tests for mapped_type_proxy.

Examples in sqlite_orm speak are:

dbstat

Aggregated database statistics:

storage.select(asterisk<dbstat_table>(), from(dbstat_table("main", true)));

generate series

Generate six random numbers:

storage.select(random(), from(generate_series_table(1, 6)))

Where the equivalent by explicitly using hidden columns is:

storage.select(random(), where(generate_series_table->*&generate_series::hidden::start == 1 and
                               generate_series_table->*&generate_series::hidden::stop == 6);

fts5

This is of course available for the fts5 module and its hidden rank column as well:

storage.get_all<post_table>(where(match<post_table>("fts5")), order_by(post_table->*&fts5::hidden::rank));

It is better to include configuration header files of third-party libraries (including SQLite) in the library's configuration header than in the umbrella header.
C++17 still requires a template argument list, only C++20 has full CTAD support.
…C++17

* Made table references available for C++17 in order to facilitate table-valued expressions.
* Eponymous virtual tables may have hidden columns, which can be used now.
* Eponymous virtual tables with hidden columns can be used like table-valued functions.
* Unit tests for `mapped_type_proxy`.
Clang has the annoying habit of warning about future C++ features that it claims to support through a feature macro.
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