Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dev/eponymous_vtabs/dbstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "../schema/column.h"
#include "../schema/table.h"
#include "../column_pointer.h"

namespace sqlite_orm {
#ifdef SQLITE_ENABLE_DBSTAT_VTAB
Expand Down Expand Up @@ -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<dbstat>();
#endif
#endif // SQLITE_ENABLE_DBSTAT_VTAB
}
6 changes: 6 additions & 0 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -23768,6 +23768,8 @@ namespace sqlite_orm {

// #include "../schema/table.h"

// #include "../column_pointer.h"

namespace sqlite_orm {
#ifdef SQLITE_ENABLE_DBSTAT_VTAB
struct dbstat {
Expand Down Expand Up @@ -23796,6 +23798,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<dbstat>();
#endif
#endif // SQLITE_ENABLE_DBSTAT_VTAB
}

Expand Down
4 changes: 4 additions & 0 deletions tests/builtin_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ TEST_CASE("builtin tables") {

auto dbstatRows = storage.get_all<dbstat>();
std::ignore = dbstatRows;

#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
dbstatRows = storage.get_all<dbstat_table>();
#endif
}
#endif // SQLITE_ENABLE_DBSTAT_VTAB
}
4 changes: 2 additions & 2 deletions tests/prepared_statement_tests/get_all.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ TEST_CASE("Prepared get all") {
}
#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
SECTION("from table reference") {
constexpr auto schema = c<sqlite_master>();
auto statement = storage.prepare(get_all<schema>(where(schema->*&sqlite_master::type == "table")));
auto statement =
storage.prepare(get_all<sqlite_master_table>(where(sqlite_master_table->*&sqlite_master::type == "table")));
auto str = storage.dump(statement);
testSerializing(statement);
}
Expand Down