Skip to content

Commit

Permalink
Add support for Cockroach DB (#9043)
Browse files Browse the repository at this point in the history
* Add support for Cockroach DB

* Add documentation, fix installation and style for CockroachDB

* Fix formatting for black
  • Loading branch information
derari authored Feb 8, 2020
1 parent 607cfd1 commit 0cf354c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ The following RDBMS are currently supported:
- `Apache Spark SQL <https://spark.apache.org/sql/>`_
- `BigQuery <https://cloud.google.com/bigquery/>`_
- `ClickHouse <https://clickhouse.yandex/>`_
- `CockroachDB <https://www.cockroachlabs.com/>`_
- `Dremio <https://dremio.com/>`_
- `Elasticsearch <https://www.elastic.co/products/elasticsearch/>`_
- `Exasol <https://www.exasol.com/>`_
Expand Down
2 changes: 2 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ Here's a list of some of the recommended packages.
+------------------+---------------------------------------+-------------------------------------------------+
| ClickHouse | ``pip install sqlalchemy-clickhouse`` | |
+------------------+---------------------------------------+-------------------------------------------------+
| CockroachDB | ``pip install cockroachdb`` | ``cockroachdb://`` |
+------------------+---------------------------------------+-------------------------------------------------+
| Dremio | ``pip install sqlalchemy_dremio`` | ``dremio://user:pwd@host:31010/`` |
+------------------+---------------------------------------+-------------------------------------------------+
| Elasticsearch | ``pip install elasticsearch-dbapi`` | ``elasticsearch+http://`` |
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def get_git_sha():
"druid": ["pydruid==0.5.7", "requests==2.22.0"],
"hana": ["hdbcli==2.4.162", "sqlalchemy_hana==0.4.0"],
"dremio": ["sqlalchemy_dremio>=0.5.0dev0"],
"cockroachdb": ["cockroachdb==0.3.3"],
},
python_requires="~=3.6",
author="Apache Software Foundation",
Expand Down
21 changes: 21 additions & 0 deletions superset/db_engine_specs/cockroachdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from superset.db_engine_specs.postgres import PostgresEngineSpec


class CockroachDbEngineSpec(PostgresEngineSpec):
engine = "cockroachdb"

0 comments on commit 0cf354c

Please sign in to comment.