feat(spanner): add Google Cloud Spanner support

This commit is contained in:
Frost authored and GitHub committed 2026-08-20 16:33:09 +08:00
1 parent 2cc8d78e64
commit f494f90c30
74 files changed
+2920 -53

No files matched your search

@@ -2,6 +2,9 @@ import type { DatabaseType } from "@/types/database";
export const SCHEMA_AWARE_TYPES = new Set<DatabaseType>([
"postgres",
// Cloud Spanner supports named schemas; GoogleSQL's default schema is the empty string, which
// `spannerObjectTreeSchema` keeps intact through the `schema || database` fallbacks.
"spanner",
"sqlserver",
"oracle",
"redshift",
@@ -55,6 +58,12 @@ export const FETCH_FIRST_TYPES = new Set<DatabaseType>(["oracle", "dameng"]);
export const TREE_SCHEMA_TYPES = new Set<DatabaseType>([
"postgres",
// Cloud Spanner needs the schema level for the same reason it is in SCHEMA_AWARE_TYPES: named
// schemas exist and are queryable, so the tree has to expose them. Membership here is what makes
// a database node load schemas instead of tables; SCHEMA_AWARE_TYPES alone only reaches the
// schema pickers in dialogs. The sites gated on `database === ""` stay unreachable because a
// Spanner database is always the resource path.
"spanner",
"redshift",
"sqlserver",
"db2",