diff --git a/dev/eponymous_vtabs/dbstat.h b/dev/eponymous_vtabs/dbstat.h index 1b674ed9b..3c56b44ba 100644 --- a/dev/eponymous_vtabs/dbstat.h +++ b/dev/eponymous_vtabs/dbstat.h @@ -6,6 +6,7 @@ #include "../schema/column.h" #include "../schema/table.h" +#include "../column_pointer.h" namespace sqlite_orm { #ifdef SQLITE_ENABLE_DBSTAT_VTAB @@ -35,5 +36,9 @@ namespace sqlite_orm { make_column("pgoffset", &dbstat::pgoffset), make_column("pgsize", &dbstat::pgsize)); } + +#ifdef SQLITE_ORM_WITH_CPP20_ALIASES + inline constexpr orm_table_reference auto dbstat_table = c(); +#endif #endif // SQLITE_ENABLE_DBSTAT_VTAB } diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index dc32f84f5..a710a5cc8 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -23924,6 +23924,8 @@ namespace sqlite_orm { // #include "../schema/table.h" +// #include "../column_pointer.h" + namespace sqlite_orm { #ifdef SQLITE_ENABLE_DBSTAT_VTAB struct dbstat { @@ -23952,6 +23954,10 @@ namespace sqlite_orm { make_column("pgoffset", &dbstat::pgoffset), make_column("pgsize", &dbstat::pgsize)); } + +#ifdef SQLITE_ORM_WITH_CPP20_ALIASES + inline constexpr orm_table_reference auto dbstat_table = c(); +#endif #endif // SQLITE_ENABLE_DBSTAT_VTAB } diff --git a/tests/builtin_tables.cpp b/tests/builtin_tables.cpp index 41fe960a3..e82d8b7a3 100644 --- a/tests/builtin_tables.cpp +++ b/tests/builtin_tables.cpp @@ -50,6 +50,10 @@ TEST_CASE("builtin tables") { auto dbstatRows = storage.get_all(); std::ignore = dbstatRows; + +#ifdef SQLITE_ORM_WITH_CPP20_ALIASES + dbstatRows = storage.get_all(); +#endif } #endif // SQLITE_ENABLE_DBSTAT_VTAB } diff --git a/tests/prepared_statement_tests/get_all.cpp b/tests/prepared_statement_tests/get_all.cpp index ff7dd3d15..26906a123 100644 --- a/tests/prepared_statement_tests/get_all.cpp +++ b/tests/prepared_statement_tests/get_all.cpp @@ -217,8 +217,8 @@ TEST_CASE("Prepared get all") { } #ifdef SQLITE_ORM_WITH_CPP20_ALIASES SECTION("from table reference") { - constexpr auto schema = c(); - auto statement = storage.prepare(get_all(where(schema->*&sqlite_master::type == "table"))); + auto statement = + storage.prepare(get_all(where(sqlite_master_table->*&sqlite_master::type == "table"))); auto str = storage.dump(statement); testSerializing(statement); }