Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RisingWave support #6776

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = """

Check warning on line 15 in redash/query_runner/risingwave.py

View check run for this annotation

Codecov / codecov/patch

redash/query_runner/risingwave.py#L15

Added line #L15 was not covered by tests
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)

Check warning on line 40 in redash/query_runner/risingwave.py

View check run for this annotation

Codecov / codecov/patch

redash/query_runner/risingwave.py#L40

Added line #L40 was not covered by tests

return list(schema.values())

Check warning on line 42 in redash/query_runner/risingwave.py

View check run for this annotation

Codecov / codecov/patch

redash/query_runner/risingwave.py#L42

Added line #L42 was not covered by tests


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
Loading