diff --git a/lib/active_record/connection_adapters/clickhouse/schema_statements.rb b/lib/active_record/connection_adapters/clickhouse/schema_statements.rb index de1d939f..fb30918e 100644 --- a/lib/active_record/connection_adapters/clickhouse/schema_statements.rb +++ b/lib/active_record/connection_adapters/clickhouse/schema_statements.rb @@ -133,6 +133,13 @@ def with_yaml_fallback(value) # :nodoc: end end + def views(name = nil) + result = do_system_execute("SHOW TABLES WHERE engine = 'View'", name) + + return [] if result.nil? + result['data'].flatten + end + private # Make HTTP request to ClickHouse server