Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: sql mode validate only enable when active

Myles Scolnick389dc4d4fd55
diff --git a/frontend/src/core/codemirror/language/languages/sql/sql.ts b/frontend/src/core/codemirror/language/languages/sql/sql.ts
index 2bc1d9c5e0..b32d3fbf36 100644
--- a/frontend/src/core/codemirror/language/languages/sql/sql.ts
+++ b/frontend/src/core/codemirror/language/languages/sql/sql.ts
@@ -666,10 +666,17 @@ function sqlValidationExtension(): Extension {
let lastValidationRequest: string | null = null;
return EditorView.updateListener.of((update) => {
+ // Only run validation if the document has changed
if (!update.docChanged) {
return;
}
+ // Only run validation if the SQL mode is set to validate
+ const sqlMode = getSQLMode();
+ if (sqlMode !== "validate") {
+ return;
+ }
+
const metadata = getSQLMetadata(update.state);
const connectionName = metadata.engine;