mirror of
https://github.com/getml/sqlgen.git
synced 2025-12-31 06:30:18 -06:00
23 lines
515 B
C++
23 lines
515 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <sqlgen.hpp>
|
|
#include <sqlgen/parsing/to_create_table.hpp>
|
|
|
|
namespace test_tablename {
|
|
|
|
struct TestTable {
|
|
using tablename = sqlgen::Literal<"TEST_TABLE">;
|
|
|
|
std::string field1;
|
|
int32_t field2;
|
|
sqlgen::PrimaryKey<uint32_t> id;
|
|
std::optional<std::string> nullable;
|
|
};
|
|
|
|
TEST(general, test_tablename) {
|
|
const auto create_table_stmt = sqlgen::parsing::to_create_table<TestTable>();
|
|
|
|
EXPECT_EQ(create_table_stmt.table.name, "TEST_TABLE");
|
|
}
|
|
} // namespace test_tablename
|