Handle schemas in SQL generation; resolves #70 (#71)

Add schema handling in SQL generation for tables.
This commit is contained in:
Marco Craveiro
2025-10-23 18:30:40 +01:00
committed by GitHub
parent 816ca6adec
commit 15108fba46

View File

@@ -751,6 +751,9 @@ std::string table_or_query_to_sql(
return _table_or_query.visit([](const auto& _t) -> std::string {
using Type = std::remove_cvref_t<decltype(_t)>;
if constexpr (std::is_same_v<Type, dynamic::Table>) {
if (_t.schema) {
return wrap_in_quotes(*_t.schema) + "." + wrap_in_quotes(_t.name);
}
return wrap_in_quotes(_t.name);
} else {
return "(" + select_from_to_sql(*_t) + ")";