dwh 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dwh/adapters/duck_db.rb +9 -9
- data/lib/dwh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 236ec4ef010d0c8645ed1199e35b5dfab533cc959ab5e6ca6a4e8bf402a1457c
|
|
4
|
+
data.tar.gz: 0cdb42b1bcd885ecaae880672efe96d8894c95cc06ee7552bb29dca69f396900
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 377c2e70b3bf535e5ca8b4803b73bbfd3088219173f76a3ca56806e156d2426f4d8b606c8df96ddad3839cf07c447c2814b46f110b18d680a8755e80480e67e9
|
|
7
|
+
data.tar.gz: 600bfd6233f11efb33f9b9071e05a4c8876421a7c9964c27da3e99d99c21bc39cf18d3ac60843a04b97938594c0c55bd4dc21cbf5e6b4a871e642da0b58708be
|
data/lib/dwh/adapters/duck_db.rb
CHANGED
|
@@ -85,19 +85,19 @@ module DWH
|
|
|
85
85
|
# (see Adapter#tables)
|
|
86
86
|
def tables(**qualifiers)
|
|
87
87
|
catalog, schema = qualifiers.values_at(:catalog, :schema)
|
|
88
|
-
|
|
88
|
+
schema_filter = schema || config[:schema]
|
|
89
89
|
|
|
90
|
-
where = []
|
|
90
|
+
where = ["schema_name = '#{schema_filter}'"]
|
|
91
91
|
where << "database_name = '#{catalog}'" if catalog
|
|
92
|
+
condition = where.join(' AND ')
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
sql = <<~SQL
|
|
95
|
+
SELECT table_name FROM duckdb_tables WHERE #{condition}
|
|
96
|
+
UNION ALL
|
|
97
|
+
SELECT view_name FROM duckdb_views WHERE #{condition}
|
|
98
|
+
SQL
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
res.flatten
|
|
100
|
+
execute(sql).flatten
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
# (see Adapter#stats)
|
data/lib/dwh/version.rb
CHANGED