Compare commits

...

4 Commits

Author SHA1 Message Date
Evan Rusackas
37b233ad73 databases.mdx entry 2025-01-03 11:46:46 -07:00
helenosheaa
13b4f144f3 feat: engine spec 2025-01-03 11:44:46 -07:00
helenosheaa
6927b87c1a docs: add influxdb 3.0 to driver list 2025-01-03 11:44:46 -07:00
helenosheaa
a9b5870089 feat: influxdb mdx 2025-01-03 11:44:06 -07:00
4 changed files with 56 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ are compatible with Superset.
| [Hologres](/docs/configuration/databases#hologres) | `pip install psycopg2` | `postgresql+psycopg2://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
| [IBM Db2](/docs/configuration/databases#ibm-db2) | `pip install ibm_db_sa` | `db2+ibm_db://` |
| [IBM Netezza Performance Server](/docs/configuration/databases#ibm-netezza-performance-server) | `pip install nzalchemy` | `netezza+nzpy://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
| [InfluxDB 3.0](/docs/databases/influxdb3) | `pip install flightsql-dbapi` | `datafusion+flightsql://{host}:443?token=<influxdb-token>&bucket-name=<bucket-name>`
| [MySQL](/docs/configuration/databases#mysql) | `pip install mysqlclient` | `mysql://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
| [OceanBase](/docs/configuration/databases#oceanbase) | `pip install oceanbase_py` | `oceanbase://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
| [Oracle](/docs/configuration/databases#oracle) | `pip install cx_Oracle` | `oracle://` |

View File

@@ -0,0 +1,18 @@
---
title: InfluxDB 3.0
hide_title: true
sidebar_position: 25
version: 1
---
## InfluxDB 3.0
The [flightsql-dbapi](https://pypi.org/project/flightsql-dbapi/) provides a DB API 2 interface and SQLAlchemy Dialect for Flight SQL that interacts with [InfluxDB 3.0](https://www.influxdata.com/products/influxdb-overview/). The primary SQLAlchemy Dialect provided by flightsql-dbapi targets the DataFusion SQL execution engine.
### DSN to connect InfluxDB 3.0 to Superset
```
datafusion+flightsql://host:443?token=<influxdb-token>&bucket-name=<bucket-name>
```
This [wiki](https://github.com/influxdata/flightsql-dbapi/wiki/InfluxDB-IOx) gives you more hints on how to use this package.

View File

@@ -0,0 +1,36 @@
# 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.constants import TimeGrain
class Influxdb3EngineSpec():
engine = "influxdb3"
engine_name = "influxdb3"
_time_grain_expressions = {
None: "{col}",
TimeGrain.SECOND: "DATE_TRUNC('second', {col})",
TimeGrain.MINUTE: "DATE_TRUNC('minute', {col})",
TimeGrain.HOUR: "DATE_TRUNC('hour', {col})",
TimeGrain.DAY: "DATE_TRUNC('day', {col})",
TimeGrain.WEEK: "DATE_TRUNC('week', {col})",
TimeGrain.MONTH: "DATE_TRUNC('month', {col})",
TimeGrain.QUARTER: "DATE_TRUNC('quarter', {col})",
TimeGrain.YEAR: "DATE_TRUNC('year', {col})",
}