From 6781c80d5970d8e5db56311272966abbeda01b85 Mon Sep 17 00:00:00 2001 From: Yevgeniy Zakharov Date: Wed, 27 Sep 2023 01:24:01 +0600 Subject: [PATCH] debug --- include/sqlite_orm/sqlite_orm.h | 167 ++++++++++++++++++++++++++++++-- tests/sync_schema_tests.cpp | 14 ++- 2 files changed, 170 insertions(+), 11 deletions(-) diff --git a/include/sqlite_orm/sqlite_orm.h b/include/sqlite_orm/sqlite_orm.h index d04a5c72d..478e088ad 100644 --- a/include/sqlite_orm/sqlite_orm.h +++ b/include/sqlite_orm/sqlite_orm.h @@ -10,6 +10,7 @@ __pragma(push_macro("max")) // #include "cxx_universal.h" + /* * This header makes central C++ functionality on which sqlite_orm depends universally available: * - alternative operator representations @@ -28,6 +29,7 @@ using std::nullptr_t; // #include "cxx_core_features.h" + /* * This header detects core C++ language features on which sqlite_orm depends. * May be updated/overwritten by cxx_compiler_quirks.h @@ -108,6 +110,7 @@ using std::nullptr_t; // #include "cxx_compiler_quirks.h" + /* * This header defines macros for circumventing compiler quirks on which sqlite_orm depends. * May amend cxx_core_features.h @@ -167,6 +170,8 @@ using std::nullptr_t; #define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS #endif + + #if SQLITE_ORM_HAS_INCLUDE() #include #endif @@ -211,6 +216,7 @@ using std::nullptr_t; // #include "cxx_universal.h" + namespace sqlite_orm { namespace internal { namespace polyfill { @@ -352,6 +358,7 @@ namespace sqlite_orm { namespace polyfill = internal::polyfill; } + namespace sqlite_orm { // C++ generic traits used throughout the library namespace internal { @@ -588,8 +595,10 @@ namespace sqlite_orm { #include // std::vector // #include "functional/cxx_optional.h" + // #include "cxx_core_features.h" + #if SQLITE_ORM_HAS_INCLUDE() #include #endif @@ -598,6 +607,7 @@ namespace sqlite_orm { #define SQLITE_ORM_OPTIONAL_SUPPORTED #endif + // #include "functional/cxx_type_traits_polyfill.h" // #include "type_traits.h" @@ -634,6 +644,7 @@ namespace sqlite_orm { }; } + namespace sqlite_orm { /** @@ -732,6 +743,7 @@ namespace sqlite_orm { // #include "functional/mpl.h" + /* * Symbols for 'template metaprogramming' (compile-time template programming), * inspired by the MPL of Aleksey Gurtovoy and David Abrahams. @@ -760,6 +772,7 @@ namespace sqlite_orm { // #include "cxx_type_traits_polyfill.h" + namespace sqlite_orm { namespace internal { namespace mpl { @@ -1045,6 +1058,7 @@ namespace sqlite_orm { // #include "tuple_helper/same_or_void.h" + namespace sqlite_orm { namespace internal { @@ -1074,6 +1088,7 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_traits.h" + #include // std::is_same #include @@ -1081,6 +1096,7 @@ namespace sqlite_orm { // #include "../functional/mpl.h" + namespace sqlite_orm { namespace internal { /* @@ -1129,6 +1145,7 @@ namespace sqlite_orm { } // #include "tuple_helper/tuple_filter.h" + #include // std::integral_constant, std::index_sequence, std::conditional, std::declval #include // std::tuple @@ -1136,10 +1153,12 @@ namespace sqlite_orm { // #include "../functional/index_sequence_util.h" + #include // std::index_sequence, std::make_index_sequence // #include "../functional/cxx_universal.h" + namespace sqlite_orm { namespace internal { /** @@ -1169,6 +1188,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { namespace internal { @@ -1260,6 +1280,7 @@ namespace sqlite_orm { // #include "table_type_of.h" + namespace sqlite_orm { namespace internal { @@ -1304,6 +1325,7 @@ namespace sqlite_orm { // #include "type_printer.h" + namespace sqlite_orm { namespace internal { @@ -1829,8 +1851,10 @@ namespace sqlite_orm { #include // std::shared_ptr, std::unique_ptr // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { /** @@ -1871,6 +1895,7 @@ namespace sqlite_orm { // #include "tags.h" + namespace sqlite_orm { namespace internal { struct negatable_t {}; @@ -1884,10 +1909,13 @@ namespace sqlite_orm { // #include "serialize_result_type.h" + // #include "functional/cxx_string_view.h" + // #include "cxx_core_features.h" + #if SQLITE_ORM_HAS_INCLUDE() #include #endif @@ -1912,6 +1940,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { namespace internal { @@ -2201,12 +2230,14 @@ namespace sqlite_orm { // #include "member_traits/member_traits.h" + #include // std::enable_if, std::is_function, std::true_type, std::false_type // #include "../functional/cxx_universal.h" // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { namespace internal { // SFINAE friendly trait to get a member object pointer's field type @@ -2298,6 +2329,7 @@ namespace sqlite_orm { // #include "constraints.h" + namespace sqlite_orm { namespace internal { @@ -2485,12 +2517,14 @@ namespace sqlite_orm { #endif // SQLITE_ORM_OMITS_CODECVT // #include "functional/cxx_optional.h" + // #include "functional/cxx_universal.h" // #include "functional/cxx_type_traits_polyfill.h" // #include "is_std_ptr.h" + namespace sqlite_orm { /** @@ -2655,6 +2689,7 @@ namespace sqlite_orm { // #include "is_base_of_template.h" + #include // std::true_type, std::false_type, std::declval namespace sqlite_orm { @@ -2700,6 +2735,7 @@ namespace sqlite_orm { // #include "optional_container.h" + namespace sqlite_orm { namespace internal { @@ -2734,6 +2770,7 @@ namespace sqlite_orm { // #include "serializer_context.h" + namespace sqlite_orm { namespace internal { @@ -2794,6 +2831,7 @@ namespace sqlite_orm { // #include "alias_traits.h" + #include // std::remove_const, std::is_base_of, std::is_same #ifdef SQLITE_ORM_WITH_CPP20_ALIASES #include @@ -2805,6 +2843,7 @@ namespace sqlite_orm { // #include "type_traits.h" + namespace sqlite_orm { /** @short Base class for a custom table alias, column alias or expression alias. @@ -2883,14 +2922,17 @@ namespace sqlite_orm { // #include "expression.h" + #include #include // std::move, std::forward // #include "functional/cxx_optional.h" + // #include "functional/cxx_universal.h" // #include "operators.h" + namespace sqlite_orm { namespace internal { @@ -2972,6 +3014,7 @@ namespace sqlite_orm { // #include "literal.h" + namespace sqlite_orm { namespace internal { @@ -2988,6 +3031,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { namespace internal { @@ -4240,13 +4284,14 @@ namespace sqlite_orm { #include // std::copy_n // #include "functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "functional/cxx_type_traits_polyfill.h" // #include "type_traits.h" // #include "alias_traits.h" + namespace sqlite_orm { namespace internal { @@ -4572,8 +4617,10 @@ namespace sqlite_orm { // #include "ast/into.h" + // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { namespace internal { @@ -4592,6 +4639,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { using int64 = sqlite_int64; @@ -6724,6 +6772,7 @@ namespace sqlite_orm { #include // std::tuple, std::get, std::tuple_size // #include "functional/cxx_optional.h" + // #include "functional/cxx_universal.h" // #include "functional/cxx_type_traits_polyfill.h" @@ -6736,6 +6785,7 @@ namespace sqlite_orm { // #include "ast/where.h" + #include // std::false_type, std::true_type #include // std::move @@ -6745,6 +6795,7 @@ namespace sqlite_orm { // #include "../serialize_result_type.h" + namespace sqlite_orm { namespace internal { @@ -6792,12 +6843,14 @@ namespace sqlite_orm { // #include "ast/group_by.h" + #include // std::tuple, std::make_tuple #include // std::true_type, std::false_type #include // std::forward, std::move // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { namespace internal { @@ -6846,6 +6899,7 @@ namespace sqlite_orm { // #include "column_pointer.h" + #include // std::string #include // std::move @@ -6855,6 +6909,7 @@ namespace sqlite_orm { // #include "alias_traits.h" + namespace sqlite_orm { namespace internal { /** @@ -6909,6 +6964,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { namespace internal { @@ -7342,6 +7398,7 @@ namespace sqlite_orm { // #include "functional/cxx_universal.h" + namespace sqlite_orm { struct table_info { @@ -7399,6 +7456,7 @@ namespace sqlite_orm { // #include "../optional_container.h" + // NOTE Idea : Maybe also implement a custom trigger system to call a c++ callback when a trigger triggers ? // (Could be implemented with a normal trigger that insert or update an internal table and then retreive // the event in the C++ code, to call the C++ user callback, with update hooks: https://www.sqlite.org/c3ref/update_hook.html) @@ -7722,6 +7780,7 @@ namespace sqlite_orm { // #include "xdestroy_handling.h" + #include // std::integral_constant #ifdef SQLITE_ORM_CPP20_CONCEPTS_SUPPORTED #include @@ -7731,6 +7790,7 @@ namespace sqlite_orm { // #include "functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { using xdestroy_fn_t = void (*)(void*); @@ -7972,6 +8032,7 @@ namespace sqlite_orm { #endif } + namespace sqlite_orm { /** @@ -8168,6 +8229,7 @@ namespace sqlite_orm { #endif // #include "../member_traits/member_traits.h" + namespace sqlite_orm { namespace internal { namespace polyfill { @@ -8251,6 +8313,7 @@ namespace sqlite_orm { // #include "pointer_value.h" + namespace sqlite_orm { /** @@ -8621,6 +8684,7 @@ namespace sqlite_orm { // #include "journal_mode.h" + #include // std::back_inserter #include // std::string #include // std::unique_ptr @@ -8697,6 +8761,7 @@ namespace sqlite_orm { // #include "is_std_ptr.h" + namespace sqlite_orm { /** @@ -9127,6 +9192,7 @@ namespace sqlite_orm { // #include "error_code.h" + namespace sqlite_orm { /** @@ -9322,6 +9388,7 @@ namespace sqlite_orm { // #include "indexed_column.h" + #include // std::string #include // std::move @@ -9329,6 +9396,7 @@ namespace sqlite_orm { // #include "ast/where.h" + namespace sqlite_orm { namespace internal { @@ -9394,6 +9462,7 @@ namespace sqlite_orm { // #include "table_type_of.h" + namespace sqlite_orm { namespace internal { @@ -9532,13 +9601,14 @@ namespace sqlite_orm { #include // std::forward, std::move // #include "functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "functional/cxx_type_traits_polyfill.h" // #include "functional/cxx_functional_polyfill.h" // #include "functional/static_magic.h" + #ifndef SQLITE_ORM_IF_CONSTEXPR_SUPPORTED #include // std::false_type, std::true_type, std::integral_constant #endif @@ -9623,16 +9693,18 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_iteration.h" + #include // std::tuple, std::get, std::tuple_element, std::tuple_size #include // std::remove_reference, std::index_sequence, std::make_index_sequence #include // std::forward, std::move // #include "../functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "../functional/cxx_type_traits_polyfill.h" // #include "../functional/cxx_functional_polyfill.h" + namespace sqlite_orm { namespace internal { @@ -9771,6 +9843,7 @@ namespace sqlite_orm { // #include "column.h" + namespace sqlite_orm { namespace internal { @@ -10168,7 +10241,7 @@ namespace sqlite_orm { #include // std::string // #include "functional/cxx_universal.h" -// ::nullptr_t + // ::nullptr_t // #include "functional/static_magic.h" // #include "tuple_helper/tuple_filter.h" @@ -10181,6 +10254,7 @@ namespace sqlite_orm { // #include "storage_lookup.h" + #include // std::true_type, std::false_type, std::remove_const, std::enable_if, std::is_base_of, std::is_void #include #include // std::index_sequence, std::make_index_sequence @@ -10191,6 +10265,7 @@ namespace sqlite_orm { // #include "type_traits.h" + namespace sqlite_orm { namespace internal { @@ -10323,6 +10398,7 @@ namespace sqlite_orm { } } + // interface functions namespace sqlite_orm { namespace internal { @@ -10386,6 +10462,7 @@ namespace sqlite_orm { // #include "storage_lookup.h" + namespace sqlite_orm { namespace internal { @@ -10422,6 +10499,7 @@ namespace sqlite_orm { #include // std::for_each, std::ranges::for_each // #include "functional/cxx_optional.h" + // #include "functional/cxx_universal.h" // #include "functional/cxx_functional_polyfill.h" @@ -10462,6 +10540,7 @@ namespace sqlite_orm { // #include "column_result.h" + #include // std::enable_if, std::is_same, std::decay, std::is_arithmetic, std::is_base_of #include // std::tuple #include // std::reference_wrapper @@ -10472,6 +10551,7 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_fy.h" + #include namespace sqlite_orm { @@ -10500,12 +10580,14 @@ namespace sqlite_orm { // #include "mapped_type_proxy.h" + #include // std::remove_const // #include "type_traits.h" // #include "alias_traits.h" + namespace sqlite_orm { namespace internal { @@ -10537,6 +10619,7 @@ namespace sqlite_orm { // #include "storage_traits.h" + #include // std::tuple // #include "functional/cxx_type_traits_polyfill.h" @@ -10545,10 +10628,12 @@ namespace sqlite_orm { // #include "tuple_helper/tuple_transformer.h" + #include // std::tuple // #include "../functional/mpl.h" + namespace sqlite_orm { namespace internal { @@ -10574,6 +10659,7 @@ namespace sqlite_orm { // #include "storage_lookup.h" + namespace sqlite_orm { namespace internal { @@ -10604,6 +10690,7 @@ namespace sqlite_orm { // #include "function.h" + #include #include #include // std::string @@ -10616,6 +10703,7 @@ namespace sqlite_orm { // #include "functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { struct arg_values; @@ -10850,6 +10938,7 @@ namespace sqlite_orm { } + namespace sqlite_orm { namespace internal { @@ -11136,6 +11225,7 @@ namespace sqlite_orm { // #include "view.h" + #include #include // std::string #include // std::forward, std::move @@ -11147,6 +11237,7 @@ namespace sqlite_orm { // #include "iterator.h" + #include #include // std::shared_ptr, std::unique_ptr, std::make_shared #include // std::decay @@ -11163,6 +11254,7 @@ namespace sqlite_orm { // #include "object_from_column_builder.h" + #include #include // std::is_member_object_pointer @@ -11170,6 +11262,7 @@ namespace sqlite_orm { // #include "row_extractor.h" + namespace sqlite_orm { namespace internal { @@ -11215,6 +11308,7 @@ namespace sqlite_orm { // #include "util.h" + namespace sqlite_orm { namespace internal { @@ -11302,6 +11396,7 @@ namespace sqlite_orm { // #include "ast_iterator.h" + #include // std::vector #include // std::reference_wrapper @@ -11321,6 +11416,7 @@ namespace sqlite_orm { // #include "prepared_statement.h" + #include #include // std::unique_ptr #include // std::iterator_traits @@ -11338,12 +11434,14 @@ namespace sqlite_orm { // #include "connection_holder.h" + #include #include #include // std::string // #include "error_code.h" + namespace sqlite_orm { namespace internal { @@ -11416,6 +11514,7 @@ namespace sqlite_orm { // #include "values.h" + #include // std::vector #include // std::tuple #include // std::forward @@ -11424,6 +11523,7 @@ namespace sqlite_orm { // #include "functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { namespace internal { @@ -11464,6 +11564,7 @@ namespace sqlite_orm { // #include "ast/upsert_clause.h" + #if SQLITE_VERSION_NUMBER >= 3024000 #include // std::tuple #include // std::forward, std::move @@ -11471,6 +11572,7 @@ namespace sqlite_orm { // #include "../functional/cxx_type_traits_polyfill.h" + namespace sqlite_orm { namespace internal { #if SQLITE_VERSION_NUMBER >= 3024000 @@ -11533,6 +11635,7 @@ namespace sqlite_orm { // #include "ast/set.h" + #include // std::tuple, std::tuple_size #include // std::string #include // std::vector @@ -11541,6 +11644,7 @@ namespace sqlite_orm { // #include "../table_name_collector.h" + #include // std::set #include // std::string #include // std::pair, std::move @@ -11559,6 +11663,7 @@ namespace sqlite_orm { // #include "storage_lookup.h" + namespace sqlite_orm { namespace internal { @@ -11648,6 +11753,7 @@ namespace sqlite_orm { } + namespace sqlite_orm { namespace internal { @@ -11747,6 +11853,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { namespace internal { @@ -12464,6 +12571,7 @@ namespace sqlite_orm { // #include "ast/excluded.h" + #include // std::move namespace sqlite_orm { @@ -12493,10 +12601,12 @@ namespace sqlite_orm { // #include "ast/exists.h" + #include // std::move // #include "../tags.h" + namespace sqlite_orm { namespace internal { @@ -12529,6 +12639,7 @@ namespace sqlite_orm { // #include "ast/match.h" + namespace sqlite_orm { namespace internal { @@ -13238,6 +13349,7 @@ namespace sqlite_orm { // #include "util.h" + namespace sqlite_orm { namespace internal { @@ -13294,6 +13406,7 @@ namespace sqlite_orm { // #include "storage_base.h" + #include #include // std::function, std::bind #include // std::string @@ -13307,11 +13420,12 @@ namespace sqlite_orm { #include // std::find_if // #include "functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "tuple_helper/tuple_iteration.h" // #include "pragma.h" + #include #include // std::string #include // std::function @@ -13331,6 +13445,7 @@ namespace sqlite_orm { // #include "serializing_util.h" + #include // std::index_sequence #include #include @@ -13339,7 +13454,7 @@ namespace sqlite_orm { #include // std::exchange, std::tuple_size // #include "functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "functional/cxx_type_traits_polyfill.h" // #include "tuple_helper/tuple_iteration.h" @@ -13352,6 +13467,7 @@ namespace sqlite_orm { // #include "util.h" + namespace sqlite_orm { namespace internal { template @@ -13714,6 +13830,7 @@ namespace sqlite_orm { } } + namespace sqlite_orm { namespace internal { @@ -13933,6 +14050,7 @@ namespace sqlite_orm { // #include "limit_accessor.h" + #include #include // std::map #include // std::function @@ -13940,6 +14058,7 @@ namespace sqlite_orm { // #include "connection_holder.h" + namespace sqlite_orm { namespace internal { @@ -14073,11 +14192,13 @@ namespace sqlite_orm { // #include "transaction_guard.h" + #include // std::function #include // std::move // #include "connection_holder.h" + namespace sqlite_orm { namespace internal { @@ -14158,6 +14279,7 @@ namespace sqlite_orm { // #include "backup.h" + #include #include // std::system_error #include // std::string @@ -14168,6 +14290,7 @@ namespace sqlite_orm { // #include "connection_holder.h" + namespace sqlite_orm { namespace internal { @@ -14235,6 +14358,7 @@ namespace sqlite_orm { // #include "values_to_tuple.h" + #include #include // std::index_sequence, std::make_index_sequence #include // std::tuple, std::tuple_size, std::get @@ -14245,10 +14369,12 @@ namespace sqlite_orm { // #include "arg_values.h" + #include // #include "row_extractor.h" + namespace sqlite_orm { /** @short Wrapper around a dynamically typed value object. @@ -14392,6 +14518,7 @@ namespace sqlite_orm { }; } + namespace sqlite_orm { namespace internal { @@ -14436,6 +14563,7 @@ namespace sqlite_orm { // #include "serializing_util.h" + namespace sqlite_orm { namespace internal { @@ -15203,11 +15331,13 @@ namespace sqlite_orm { // #include "expression_object_type.h" + #include // std::decay #include // std::reference_wrapper // #include "prepared_statement.h" + namespace sqlite_orm { namespace internal { @@ -15341,6 +15471,7 @@ namespace sqlite_orm { // #include "statement_serializer.h" + #include // std::stringstream #include // std::string #include // std::enable_if, std::remove_pointer @@ -15355,6 +15486,7 @@ namespace sqlite_orm { // #include "functional/cxx_optional.h" + // #include "functional/cxx_universal.h" // #include "functional/cxx_functional_polyfill.h" @@ -15375,6 +15507,7 @@ namespace sqlite_orm { // #include "ast/rank.h" + namespace sqlite_orm { namespace internal { struct rank_t {}; @@ -15413,6 +15546,7 @@ namespace sqlite_orm { // #include "column_names_getter.h" + #include // std::is_base_of #include // std::string #include // std::vector @@ -15433,11 +15567,12 @@ namespace sqlite_orm { // #include "select_constraints.h" // #include "storage_lookup.h" -// pick_table + // pick_table // #include "serializer_context.h" // #include "util.h" + namespace sqlite_orm { namespace internal { @@ -15540,6 +15675,7 @@ namespace sqlite_orm { // #include "order_by_serializer.h" + #include // std::string #include // std::stringstream @@ -15631,6 +15767,7 @@ namespace sqlite_orm { // #include "util.h" + namespace sqlite_orm { namespace internal { @@ -17692,6 +17829,7 @@ namespace sqlite_orm { // #include "serializing_util.h" + namespace sqlite_orm { namespace internal { @@ -19135,7 +19273,7 @@ namespace sqlite_orm { #include // std::get // #include "functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "functional/static_magic.h" // #include "prepared_statement.h" @@ -19144,12 +19282,14 @@ namespace sqlite_orm { // #include "node_tuple.h" + #include // std::enable_if #include // std::tuple #include // std::pair #include // std::reference_wrapper // #include "functional/cxx_optional.h" + // #include "functional/cxx_type_traits_polyfill.h" // #include "tuple_helper/tuple_filter.h" @@ -19180,6 +19320,7 @@ namespace sqlite_orm { // #include "ast/match.h" + namespace sqlite_orm { namespace internal { @@ -19490,6 +19631,7 @@ namespace sqlite_orm { // #include "expression_object_type.h" + namespace sqlite_orm { template @@ -19669,6 +19811,7 @@ namespace sqlite_orm { // #include "pointer_value.h" + namespace sqlite_orm { inline constexpr const char carray_pvt_name[] = "carray"; @@ -19743,6 +19886,7 @@ namespace sqlite_orm { // #include "alias.h" + namespace sqlite_orm { /** * SQLite's "schema table" that stores the schema for a database. @@ -19788,6 +19932,7 @@ namespace sqlite_orm { // #include "../schema/table.h" + namespace sqlite_orm { #ifdef SQLITE_ENABLE_DBSTAT_VTAB struct dbstat { @@ -19830,6 +19975,7 @@ namespace sqlite_orm { * this file is also used to provide definitions of interface methods 'hitting the database'. */ + #include // std::make_unique // #include "../functional/cxx_core_features.h" @@ -19846,6 +19992,7 @@ namespace sqlite_orm { // #include "../column.h" + namespace sqlite_orm { namespace internal { @@ -19880,13 +20027,14 @@ namespace sqlite_orm { #include // std::find_if, std::ranges::find // #include "../functional/cxx_universal.h" -// ::size_t + // ::size_t // #include "../type_printer.h" // #include "../column.h" // #include "../schema/table.h" + namespace sqlite_orm { namespace internal { @@ -19951,6 +20099,7 @@ namespace sqlite_orm { // #include "../storage.h" + namespace sqlite_orm { namespace internal { diff --git a/tests/sync_schema_tests.cpp b/tests/sync_schema_tests.cpp index 4b5edb5fc..e48e7ce5a 100644 --- a/tests/sync_schema_tests.cpp +++ b/tests/sync_schema_tests.cpp @@ -4,6 +4,9 @@ using namespace sqlite_orm; +using std::cout; +using std::endl; + /** * this is the deal: assume we have a `users` table with schema * `CREATE TABLE users (id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL, category_id INTEGER, surname TEXT)`. @@ -40,13 +43,20 @@ TEST_CASE("Sync schema") { make_column("id", &UserBefore::id, primary_key()), make_column("name", &UserBefore::name), make_column("category_id", &UserBefore::categoryId), - make_column("surname", &UserBefore::surname))); + make_column("surname", &UserBefore::surname)), + make_sqlite_schema_table()); // sync in case if it is first launch auto syncSchemaSimulationRes = storage.sync_schema_simulate(); auto syncSchemaRes = storage.sync_schema(); - REQUIRE(syncSchemaRes == syncSchemaSimulationRes); +// REQUIRE(syncSchemaRes == syncSchemaSimulationRes); + + auto schemas = storage.get_all(); + cout << "[!] schemas size = " << schemas.size() << endl; + for (auto &schema : schemas) { + cout << "\t[!] name = " << schema.name << ", sql = " << schema.sql << endl; + } // create c++ objects to insert into table std::vector usersToInsert;