mirror of
https://github.com/getml/sqlgen.git
synced 2025-12-31 06:30:18 -06:00
24 lines
517 B
C++
24 lines
517 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <sqlgen.hpp>
|
|
#include <sqlgen/transpilation/to_create_table.hpp>
|
|
|
|
namespace test_schema {
|
|
|
|
struct TestTable {
|
|
static constexpr const char* schema = "test";
|
|
|
|
std::string field1;
|
|
int32_t field2;
|
|
sqlgen::PrimaryKey<uint32_t> id;
|
|
std::optional<std::string> nullable;
|
|
};
|
|
|
|
TEST(general, test_schema) {
|
|
const auto create_table_stmt =
|
|
sqlgen::transpilation::to_create_table<TestTable>();
|
|
|
|
EXPECT_EQ(create_table_stmt.table.schema, "test");
|
|
}
|
|
} // namespace test_schema
|