Skip to content
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
---

### Connect
Supports all major databases: SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, FirebirdSQL, Oracle, DuckDB, CockroachDB, ClickHouse, Snowflake, Supabase, CloudFlare D1, Turso, Athena, BigQuery, Spanner, RedShift, IBM Db2, SAP HANA, Teradata, Trino, Presto and Apache Flight SQL.
Supports all major databases: SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, FirebirdSQL, Oracle, DuckDB, CockroachDB, ClickHouse, Snowflake, Supabase, CloudFlare D1, Turso, Athena, BigQuery, Spanner, RedShift, IBM Db2, SAP HANA, Teradata, Trino, Presto, Apache Flight SQL, Apache Impala, SurrealDB and osquery.

![Database Providers](docs/demos/demo-providers.gif)

Expand Down Expand Up @@ -286,6 +286,9 @@ Most of the time you can just run `sqlit` and connect. If a Python driver is mis
| BigQuery | `google-cloud-bigquery` | `pipx inject sqlit-tui google-cloud-bigquery` | `python -m pip install google-cloud-bigquery` |
| Spanner | `google-cloud-spanner` | `pipx inject sqlit-tui google-cloud-spanner` | `python -m pip install google-cloud-spanner` |
| Apache Arrow Flight SQL | `adbc-driver-flightsql` | `pipx inject sqlit-tui adbc-driver-flightsql` | `python -m pip install adbc-driver-flightsql` |
| Apache Impala | `impyla` | `pipx inject sqlit-tui impyla` | `python -m pip install impyla` |
| SurrealDB | `surrealdb` | `pipx inject sqlit-tui surrealdb` | `python -m pip install surrealdb` |
| osquery | `osquery` | `pipx inject sqlit-tui osquery` | `python -m pip install osquery` |

### SSH Tunnel Support

Expand Down
118 changes: 118 additions & 0 deletions infra/docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,101 @@ services:
retries: 10
start_period: 10s

# Apache Impala ships no single-container image. The official quickstart runs
# Hive Metastore + statestored + catalogd + impalad together, all pinned to
# apache/impala:4.5.0-* with hive-site.xml mounted from impala_quickstart_conf/.
# Based on https://github.com/apache/impala/blob/master/docker/quickstart.yml
impala-hms:
image: apache/impala:4.5.0-impala_quickstart_hms
container_name: sqlit-test-impala-hms
command: ["hms"]
volumes:
- impala-warehouse:/var/lib/hive
- impala-warehouse:/user/hive/warehouse
- ./impala_quickstart_conf:/opt/hive/conf:ro
# hive-site.xml refers to the metastore as `thrift://quickstart-hive-metastore:9083`
# (matching the upstream quickstart). Alias so catalogd/impalad can resolve it.
networks:
impala-network:
aliases:
- quickstart-hive-metastore
profiles:
- enterprise

impala-statestored:
image: apache/impala:4.5.0-statestored
container_name: sqlit-test-impala-statestored
command: ["-redirect_stdout_stderr=false", "-logtostderr", "-v=1"]
volumes:
- ./impala_quickstart_conf:/opt/impala/conf:ro
# Impala hard-codes peer hostnames `statestored` and `catalogd` when the
# services register — alias so the other containers can reach it there.
networks:
impala-network:
aliases:
- statestored
profiles:
- enterprise

impala-catalogd:
image: apache/impala:4.5.0-catalogd
container_name: sqlit-test-impala-catalogd
depends_on:
- impala-statestored
- impala-hms
command:
- "-redirect_stdout_stderr=false"
- "-logtostderr"
- "-v=1"
- "-hms_event_polling_interval_s=1"
- "-invalidate_tables_timeout_s=999999"
volumes:
- impala-warehouse:/user/hive/warehouse
- ./impala_quickstart_conf:/opt/impala/conf:ro
networks:
impala-network:
aliases:
- catalogd
profiles:
- enterprise

impala:
image: apache/impala:4.5.0-impalad_coord_exec
container_name: sqlit-test-impala
depends_on:
- impala-statestored
- impala-catalogd
command:
- "-v=1"
- "-redirect_stdout_stderr=false"
- "-logtostderr"
- "-mt_dop_auto_fallback=true"
- "-default_query_options=mt_dop=4,default_file_format=parquet,default_transactional_type=insert_only"
- "-mem_limit=4gb"
environment:
- JAVA_TOOL_OPTIONS=-Xmx1g
ports:
- "${IMPALA_PORT:-21050}:21050"
volumes:
- impala-warehouse:/user/hive/warehouse
- ./impala_quickstart_conf:/opt/impala/conf:ro
networks:
- impala-network
healthcheck:
# /bin/sh in this image is dash, which doesn't support bash's /dev/tcp.
# The Impala image ships Python, so use that for a tiny TCP probe.
test:
- "CMD"
- "python"
- "-c"
- "import socket,sys; s=socket.socket(); s.settimeout(2); s.connect(('localhost',21050)); sys.exit(0)"
interval: 10s
timeout: 5s
retries: 30
start_period: 90s
profiles:
- enterprise

mariadb:
image: mariadb:11
container_name: sqlit-test-mariadb
Expand Down Expand Up @@ -220,6 +315,20 @@ services:
retries: 10
start_period: 10s

surrealdb:
image: surrealdb/surrealdb:latest
container_name: sqlit-test-surrealdb
command: start --user root --pass root --bind 0.0.0.0:8000 memory
ports:
- "${SURREALDB_PORT:-8000}:8000"
healthcheck:
test: ["CMD", "/surreal", "is-ready", "--endpoint", "http://localhost:8000"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s


firebird:
image: firebirdsql/firebird:5.0.3-noble
container_name: sqlit-test-firebird
Expand Down Expand Up @@ -333,3 +442,12 @@ services:
timeout: 5s
retries: 10
start_period: 10s

volumes:
impala-warehouse:

networks:
impala-network:
# Underscore-free FQDN: Java's URL parser rejects hostnames with underscores,
# which is why we can't let compose auto-prefix the network name.
name: impalanet
74 changes: 74 additions & 0 deletions infra/docker/impala_quickstart_conf/hive-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
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.
-->
<!--
Hive configuration for Impala quickstart docker cluster.
-->
<configuration>
<property>
<!-- Required for automatic metadata sync. -->
<name>hive.metastore.dml.events</name>
<value>true</value>
</property>
<property>
<!-- User impala is not authorized to consume notifications by default, disable
authentication to work around this. -->
<name>hive.metastore.event.db.notification.api.auth</name>
<value>false</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://quickstart-hive-metastore:9083</value>
</property>
<!-- Managed and external tablespaces must live on the Docker volumes that we
configure for the quickstart cluster. -->
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse/managed</value>
</property>
<property>
<name>hive.metastore.warehouse.external.dir</name>
<value>/user/hive/warehouse/external</value>
</property>
<property>
<!-- Required to enable Hive transactions -->
<name>hive.support.concurrency</name>
<value>true</value>
</property>
<property>
<!-- Required to enable Hive transactions -->
<name>hive.txn.manager</name>
<value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value>
</property>
<property>
<!-- Use embedded Derby database -->
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
</property>
<property>
<!-- Use embedded Derby database -->
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true</value>
</property>
<!-- Hive stats autogathering negatively affects latency of DDL operations, etc and
is not particularly useful for Impala -->
<property>
<name>hive.stats.autogather</name>
<value>false</value>
</property>
</configuration>
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ all = [
"redshift-connector",
"pyathena>=3.22.0",
"adbc-driver-flightsql>=1.0.0",
"impyla>=0.18.0",
"osquery>=3.0.0",
"surrealdb>=1.0.0",
]
postgres = ["psycopg2-binary>=2.9.0"]
cockroachdb = ["psycopg2-binary>=2.9.0"]
Expand All @@ -83,6 +86,9 @@ firebird = ["firebirdsql>=1.3.5"]
snowflake = ["snowflake-connector-python>=3.7.0"]
athena = ["pyathena>=3.22.0"]
flight = ["adbc-driver-flightsql>=1.0.0"]
impala = ["impyla>=0.18.0"]
osquery = ["osquery>=3.0.0"]
surrealdb = ["surrealdb>=1.0.0"]
ssh = [
"sshtunnel>=0.4.0",
"paramiko>=2.0.0,<4.0.0",
Expand Down Expand Up @@ -245,6 +251,10 @@ module = [
"adbc_driver_flightsql.dbapi",
"adbc_driver_manager",
"textual_fastdatatable",
"impala",
"impala.dbapi",
"osquery",
"surrealdb",
"google.cloud",
"google.cloud.bigquery",
"google.cloud.bigquery.dbapi",
Expand Down
6 changes: 6 additions & 0 deletions sqlit/domains/connections/domain/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ class DatabaseType(str, Enum):
FIREBIRD = "firebird"
FLIGHT = "flight"
HANA = "hana"
IMPALA = "impala"
MARIADB = "mariadb"
MOTHERDUCK = "motherduck"
MSSQL = "mssql"
MYSQL = "mysql"
ORACLE = "oracle"
ORACLE_LEGACY = "oracle_legacy"
OSQUERY = "osquery"
POSTGRESQL = "postgresql"
PRESTO = "presto"
REDSHIFT = "redshift"
SNOWFLAKE = "snowflake"
SPANNER = "spanner"
SQLITE = "sqlite"
SUPABASE = "supabase"
SURREALDB = "surrealdb"
TERADATA = "teradata"
TRINO = "trino"
TURSO = "turso"
Expand All @@ -54,6 +57,7 @@ class DatabaseType(str, Enum):
DatabaseType.SPANNER,
DatabaseType.TRINO,
DatabaseType.PRESTO,
DatabaseType.IMPALA,
DatabaseType.DUCKDB,
DatabaseType.MOTHERDUCK,
DatabaseType.REDSHIFT,
Expand All @@ -65,6 +69,8 @@ class DatabaseType(str, Enum):
DatabaseType.ATHENA,
DatabaseType.FIREBIRD,
DatabaseType.FLIGHT,
DatabaseType.OSQUERY,
DatabaseType.SURREALDB,
]


Expand Down
1 change: 1 addition & 0 deletions sqlit/domains/connections/providers/impala/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Impala provider package."""
Loading
Loading