Skip to content

Commit 8f9bf98

Browse files
authored
Merge pull request #137 from fredrikaverpil/feat/spanner
2 parents 9f9b362 + a933b36 commit 8f9bf98

File tree

11 files changed

+1154
-4
lines changed

11 files changed

+1154
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
---
2626

2727
### Connect
28-
Supports all major databases: SQL Server, PostgreSQL, MySQL, SQLite, MariaDB, FirebirdSQL, Oracle, DuckDB, CockroachDB, ClickHouse, Snowflake, Supabase, CloudFlare D1, Turso, Athena, BigQuery, RedShift, IBM Db2, SAP HANA, Teradata, Trino, Presto and Apache Flight SQL.
28+
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.
2929

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

@@ -281,6 +281,8 @@ Most of the time you can just run `sqlit` and connect. If a Python driver is mis
281281
| Snowflake | `snowflake-connector-python` | `pipx inject sqlit-tui snowflake-connector-python` | `python -m pip install snowflake-connector-python` |
282282
| Firebird | `firebirdsql` | `pipx inject sqlit-tui firebirdsql` | `python -m pip install firebirdsql` |
283283
| Athena | `pyathena` | `pipx inject sqlit-tui pyathena` | `python -m pip install pyathena` |
284+
| BigQuery | `google-cloud-bigquery` | `pipx inject sqlit-tui google-cloud-bigquery` | `python -m pip install google-cloud-bigquery` |
285+
| Spanner | `google-cloud-spanner` | `pipx inject sqlit-tui google-cloud-spanner` | `python -m pip install google-cloud-spanner` |
284286
| Apache Arrow Flight SQL | `adbc-driver-flightsql` | `pipx inject sqlit-tui adbc-driver-flightsql` | `python -m pip install adbc-driver-flightsql` |
285287

286288
### SSH Tunnel Support

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ all = [
4848
"trino>=0.329.0",
4949
"presto-python-client>=0.8.4",
5050
"google-cloud-bigquery",
51+
"google-cloud-spanner>=3.0.0",
5152
"duckdb>=1.1.0", # min avoids known CVEs
5253
"clickhouse-connect>=0.7.0",
5354
"requests>=2.32.4", # min avoids known CVEs
@@ -72,6 +73,7 @@ teradata = ["teradatasql>=20.0.0"]
7273
trino = ["trino>=0.329.0"]
7374
presto = ["presto-python-client>=0.8.4"]
7475
bigquery = ["google-cloud-bigquery"]
76+
spanner = ["google-cloud-spanner>=3.0.0"]
7577
redshift = ["redshift-connector"]
7678
duckdb = ["duckdb>=1.1.0"] # min avoids known CVEs
7779
clickhouse = ["clickhouse-connect>=0.7.0"]
@@ -187,6 +189,7 @@ markers = [
187189
"firebird: Firebird database tests",
188190
"clickhouse: ClickHouse database tests",
189191
"flight: Apache Arrow Flight SQL database tests",
192+
"spanner: Google Cloud Spanner database tests",
190193
"asyncio: async tests",
191194
"integration: integration tests (may require external services)",
192195
]
@@ -241,7 +244,18 @@ module = [
241244
"adbc_driver_flightsql",
242245
"adbc_driver_flightsql.dbapi",
243246
"adbc_driver_manager",
244-
"textual_fastdatatable"
247+
"textual_fastdatatable",
248+
"google.cloud",
249+
"google.cloud.bigquery",
250+
"google.cloud.bigquery.dbapi",
251+
"google.cloud.spanner",
252+
"google.cloud.spanner_dbapi",
253+
"google.api_core",
254+
"google.api_core.client_options",
255+
"google.auth",
256+
"google.auth.credentials",
257+
"google.oauth2",
258+
"google.oauth2.service_account",
245259
]
246260
ignore_missing_imports = true
247261

sqlit/domains/connections/domain/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class DatabaseType(str, Enum):
2929
PRESTO = "presto"
3030
REDSHIFT = "redshift"
3131
SNOWFLAKE = "snowflake"
32+
SPANNER = "spanner"
3233
SQLITE = "sqlite"
3334
SUPABASE = "supabase"
3435
TERADATA = "teradata"
@@ -50,6 +51,7 @@ class DatabaseType(str, Enum):
5051
DatabaseType.TERADATA,
5152
DatabaseType.SNOWFLAKE,
5253
DatabaseType.BIGQUERY,
54+
DatabaseType.SPANNER,
5355
DatabaseType.TRINO,
5456
DatabaseType.PRESTO,
5557
DatabaseType.DUCKDB,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Google Cloud Spanner provider package."""

0 commit comments

Comments
 (0)