mirror of
https://github.com/getml/sqlgen.git
synced 2026-01-07 18:09:32 -06:00
Add schema handling in SQL generation for tables.
This commit is contained in:
@@ -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) + ")";
|
||||
|
||||
Reference in New Issue
Block a user