Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Fixed syncing eponymous virtual table dbstat
Browse files Browse the repository at this point in the history
  • Loading branch information
trueqbit committed Mar 23, 2023
1 parent 8b0704e commit e041fb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dev/implementations/storage_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <algorithm> // std::find_if, std::ranges::find

#include "../dbstat.h"
#include "../type_traits.h"
#include "../util.h"
#include "../serializing_util.h"
#include "../storage.h"
Expand All @@ -20,7 +21,7 @@ namespace sqlite_orm {
template<class Table, satisfies<is_table, Table>>
sync_schema_result storage_t<DBO...>::sync_table(const Table& table, sqlite3* db, bool preserve) {
#ifdef SQLITE_ENABLE_DBSTAT_VTAB
if(std::is_same<Table, dbstat>::value) {
if(std::is_same<object_type_t<Table>, dbstat>::value) {
return sync_schema_result::already_in_sync;
}
#endif // SQLITE_ENABLE_DBSTAT_VTAB
Expand Down
8 changes: 3 additions & 5 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ using std::nullptr_t;
#define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS
#endif

#if SQLITE_ORM_HAS_INCLUDE(<version>)
#include <version>
#endif

#ifdef SQLITE_ORM_INLINE_VARIABLES_SUPPORTED
#define SQLITE_ORM_INLINE_VAR inline
#else
Expand Down Expand Up @@ -19364,6 +19360,8 @@ namespace sqlite_orm {

// #include "../dbstat.h"

// #include "../type_traits.h"

// #include "../util.h"

// #include "../serializing_util.h"
Expand All @@ -19377,7 +19375,7 @@ namespace sqlite_orm {
template<class Table, satisfies<is_table, Table>>
sync_schema_result storage_t<DBO...>::sync_table(const Table& table, sqlite3* db, bool preserve) {
#ifdef SQLITE_ENABLE_DBSTAT_VTAB
if(std::is_same<Table, dbstat>::value) {
if(std::is_same<object_type_t<Table>, dbstat>::value) {
return sync_schema_result::already_in_sync;
}
#endif // SQLITE_ENABLE_DBSTAT_VTAB
Expand Down

0 comments on commit e041fb4

Please sign in to comment.