Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fnc12 committed May 5, 2024
1 parent 3f6a287 commit 467037f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dev/statement_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ namespace sqlite_orm {
using statement_type = unindexed_t;

template<class Ctx>
std::string operator()(const statement_type& c, const Ctx& context) const {
serialize_result_type operator()(const statement_type& c, const Ctx& context) const {
return "UNINDEXED";
}
};
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ add_executable(unit_tests
statement_serializer_tests/schema/using_fts5.cpp
statement_serializer_tests/schema/virtual_table.cpp
statement_serializer_tests/schema/column.cpp
statement_serializer_tests/schema/table.cpp
statement_serializer_tests/indexed_column.cpp
statement_serializer_tests/logical_operators.cpp
statement_serializer_tests/statements/select.cpp
Expand Down
4 changes: 2 additions & 2 deletions tests/statement_serializer_tests/schema/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TEST_CASE("statement_serializer table_t") {
using context_t = internal::serializer_context<db_objects_t>;
context_t context{dbObjects};
value = internal::serialize(table, context);
expected = "CREATE TABLE \"users\" (\"id\" INTEGER NOT NULL, \"name\" TEXT NOT NULL)";
expected = R"(CREATE TABLE "users" ("id" INTEGER NOT NULL, "name" TEXT NOT NULL))";
}
SECTION("without_rowid") {
auto table =
Expand All @@ -27,7 +27,7 @@ TEST_CASE("statement_serializer table_t") {
using context_t = internal::serializer_context<db_objects_t>;
context_t context{dbObjects};
value = internal::serialize(table, context);
expected = "CREATE TABLE \"users\" (\"id\" INTEGER NOT NULL, \"name\" TEXT NOT NULL) WITHOUT ROWID";
expected = R"(CREATE TABLE "users" ("id" INTEGER NOT NULL, "name" TEXT NOT NULL) WITHOUT ROWID)";
}
REQUIRE(value == expected);
}
4 changes: 2 additions & 2 deletions tests/statement_serializer_tests/schema/using_fts5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ TEST_CASE("statement_serializer using_fts5") {
SECTION("simple") {
auto node = using_fts5(make_column("title", &Post::title), make_column("body", &Post::body));
value = serialize(node, context);
expected = "USING FTS5(\"title\", \"body\")";
expected = R"(USING FTS5("title", "body"))";
}
SECTION("unindexed") {
auto node = using_fts5(make_column("title", &Post::title), make_column("body", &Post::body, unindexed()));
value = serialize(node, context);
expected = "USING FTS5(\"title\", \"body\" UNINDEXED)";
expected = R"(USING FTS5("title", "body" UNINDEXED))";
}
REQUIRE(value == expected);
}

0 comments on commit 467037f

Please sign in to comment.