mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 16:04:21 +00:00
feat(database): add Snowflake data sources (#2972)
Snowflake is a built-in data source kind: connection dialog, key-pair, browser single sign-on, password or token sign-in, the database tree, SQL consoles, and Snowflake-aware SQL assistance and syntax colours. The driver speaks Snowflake's session protocol over the existing reqwest + rustls stack, with no JDBC/ODBC or native library and no new package. Metadata is read with SHOW / DESCRIBE, which need no running warehouse; introspected names are kept on disk for completion. Co-authored-by: vvnadolskyy <12991410+vvnadolskyy@users.noreply.github.com>
This commit is contained in:
@@ -36,6 +36,8 @@ export function findParams(text: string, driver: DbDriver, numbered = 0): SqlPar
|
||||
if (t.kind === "param") {
|
||||
// MySQL `@var` / `@@var` are session variables.
|
||||
if (driver === "mysql" && t.text.startsWith("@")) return;
|
||||
// Snowflake `@stage` references, `$1` columns, `$name` session variables and `file://` locations.
|
||||
if (driver === "snowflake" && /^[@$]|^\w+:\/\//.test(t.text)) return;
|
||||
if (toks[i - 1]?.text === "@") return;
|
||||
out.push({ name: t.text, from: t.from, to: t.to });
|
||||
} else if (t.kind === "punct" && t.text === "?" && driver !== "postgres") {
|
||||
|
||||
Reference in New Issue
Block a user