Skip to content

Commit 34723e2

Browse files
authored
Add RisingWave support (#6776)
1 parent 11794b3 commit 34723e2

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
8484
- Python
8585
- Qubole
8686
- Rockset
87+
- RisingWave
8788
- Salesforce
8889
- ScyllaDB
8990
- Shell Scripts
9.68 KB
Loading

redash/query_runner/risingwave.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from redash.query_runner import register
2+
from redash.query_runner.pg import PostgreSQL
3+
4+
5+
class RisingWave(PostgreSQL):
6+
@classmethod
7+
def type(cls):
8+
return "risingwave"
9+
10+
@classmethod
11+
def name(cls):
12+
return "RisingWave"
13+
14+
def _get_tables(self, schema):
15+
query = """
16+
SELECT s.nspname as table_schema,
17+
c.relname as table_name,
18+
a.attname as column_name,
19+
null as data_type
20+
FROM pg_class c
21+
JOIN pg_namespace s
22+
ON c.relnamespace = s.oid
23+
AND s.nspname NOT IN ('pg_catalog', 'information_schema', 'rw_catalog')
24+
JOIN pg_attribute a
25+
ON a.attrelid = c.oid
26+
AND a.attnum > 0
27+
AND NOT a.attisdropped
28+
WHERE c.relkind IN ('m', 'f', 'p')
29+
30+
UNION
31+
32+
SELECT table_schema,
33+
table_name,
34+
column_name,
35+
data_type
36+
FROM information_schema.columns
37+
WHERE table_schema NOT IN ('pg_catalog', 'information_schema', 'rw_catalog');
38+
"""
39+
40+
self._get_definitions(schema, query)
41+
42+
return list(schema.values())
43+
44+
45+
register(RisingWave)

redash/settings/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def email_server_is_configured():
339339
"redash.query_runner.ignite",
340340
"redash.query_runner.oracle",
341341
"redash.query_runner.e6data",
342+
"redash.query_runner.risingwave",
342343
]
343344

344345
enabled_query_runners = array_from_string(

0 commit comments

Comments
 (0)