Skip to content

Commit

Permalink
Add RisingWave support (getredash#6776)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefannegele authored Mar 5, 2024
1 parent 11794b3 commit 34723e2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
- Python
- Qubole
- Rockset
- RisingWave
- Salesforce
- ScyllaDB
- Shell Scripts
Expand Down
Binary file added client/app/assets/images/db-logos/risingwave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions redash/query_runner/risingwave.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from redash.query_runner import register
from redash.query_runner.pg import PostgreSQL


class RisingWave(PostgreSQL):
@classmethod
def type(cls):
return "risingwave"

@classmethod
def name(cls):
return "RisingWave"

def _get_tables(self, schema):
query = """
SELECT s.nspname as table_schema,
c.relname as table_name,
a.attname as column_name,
null as data_type
FROM pg_class c
JOIN pg_namespace s
ON c.relnamespace = s.oid
AND s.nspname NOT IN ('pg_catalog', 'information_schema', 'rw_catalog')
JOIN pg_attribute a
ON a.attrelid = c.oid
AND a.attnum > 0
AND NOT a.attisdropped
WHERE c.relkind IN ('m', 'f', 'p')
UNION
SELECT table_schema,
table_name,
column_name,
data_type
FROM information_schema.columns
WHERE table_schema NOT IN ('pg_catalog', 'information_schema', 'rw_catalog');
"""

self._get_definitions(schema, query)

return list(schema.values())


register(RisingWave)
1 change: 1 addition & 0 deletions redash/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def email_server_is_configured():
"redash.query_runner.ignite",
"redash.query_runner.oracle",
"redash.query_runner.e6data",
"redash.query_runner.risingwave",
]

enabled_query_runners = array_from_string(
Expand Down

0 comments on commit 34723e2

Please sign in to comment.