{"record":{"id":"f7240151e6d2efb1","repo":"windmill-labs/windmill","slug":"unsupported-database-type-f72401","errorCode":null,"errorMessage":"Unsupported database type","messagePattern":"Unsupported database type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/apps/components/display/dbtable/queries/update.ts","lineNumber":84,"sourceCode":"\t\tcase 'bigquery': {\n\t\t\tconst conditions = columns\n\t\t\t\t.map(\n\t\t\t\t\t(c, i) =>\n\t\t\t\t\t\t`(CAST(@${c.field} AS STRING) = 'null' AND ${c.field} IS NULL OR ${c.field} = @${c.field})`\n\t\t\t\t)\n\t\t\t\t.join('\\n    AND ')\n\t\t\tquery += `\\nUPDATE ${table} SET ${column.field} = @value_to_update \\nWHERE ${conditions}`\n\t\t\treturn query\n\t\t}\n\t\tcase 'duckdb': {\n\t\t\tconst conditions = columns\n\t\t\t\t.map((c) => `($${c.field} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${c.field})`)\n\t\t\t\t.join('\\n    AND ')\n\t\t\tquery += `\\nUPDATE ${table} SET ${column.field} = $value_to_update \\nWHERE ${conditions}`\n\t\t\treturn query\n\t\t}\n\t\tdefault:\n\t\t\tthrow new Error('Unsupported database type')\n\t}\n}\n\nexport function getUpdateInput(\n\tdbInput: DbInput,\n\ttable: string,\n\tcolumn: ColumnDef,\n\tcolumns: ColumnDef[]\n): AppInput | undefined {\n\tif (\n\t\t(dbInput.type == 'ducklake' && !dbInput.ducklake) ||\n\t\t(dbInput.type == 'database' && !dbInput.resourcePath) ||\n\t\t!table\n\t) {\n\t\treturn undefined\n\t}\n\tconst dbType = dbInput.type === 'ducklake' ? 'duckdb' : dbInput.resourceType\n\tlet query = makeUpdateQuery(table, column, columns, dbType)","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/apps/components/display/dbtable/queries/update.ts#L66-L102","documentation":"makeUpdateQuery generates the UPDATE SQL used by legacy Database Studio (dbexplorercomponent) apps. It supports postgresql, mysql, ms_sql_server, snowflake, bigquery and duckdb; any other dbType reaches the default arm and throws 'Unsupported database type'. Note this is the LEGACY builder — new Database Manager apps never hit it.","triggerScenarios":"Calling makeUpdateQuery(table, column, columns, dbType) with a dbType outside the six-case switch, e.g. an unresolved DbInput (undefined), a ducklake input where dbInput.ducklake is set so the getUpdateInput guard doesn't bail out first, or a newly added DbType without an update-query case.","commonSituations":"Editing a cell in a Database Studio app backed by an unsupported/new database resource; dbType string from a resource that was renamed; mixed inputs where the type guard in getUpdateInput passes but the switch has no case (e.g. a snowflake_oauth-style alias); frontend/backendDbType divergence after an upgrade.","solutions":["Verify the app's database resource type is one of postgresql, mysql, ms_sql_server, snowflake, bigquery, duckdb; change the resource if not","Inspect the dbType argument at the call site (query in the dbtable component) — undefined indicates an unresolved DbInput, fix the input binding","For new apps, migrate to the Database Manager flow (dbOps.ts → dbTableOpsWithPreviewScripts with WM_INTERNAL_DB markers) instead of the legacy expanded-SQL builder","Add a missing case to the switch in update.ts if a supported backend DbType was added without frontend support, then redeploy the app"],"exampleFix":"// before\nmakeUpdateQuery(table, column, columns, dbType) // dbType: DbType | undefined\n// after\nif (!dbType || !SUPPORTED_DB_TYPES.includes(dbType)) {\n  throw new Error(`Update not supported for database type: ${dbType}`)\n}\nmakeUpdateQuery(table, column, columns, dbType)","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['postgresql','mysql','ms_sql_server','snowflake','bigquery','duckdb']\nif (!dbType || !SUPPORTED.includes(dbType)) {\n  throw new Error(`Inline update not supported for database type: ${dbType}`)\n}","typeGuard":"function canBuildUpdateQuery(dbType: unknown): dbType is DbType {\n  return typeof dbType === 'string' &&\n    ['postgresql','mysql','ms_sql_server','snowflake','bigquery','duckdb'].includes(dbType)\n}","tryCatchPattern":"try {\n  const sql = makeUpdateQuery(table, column, columns, dbType)\n} catch (e) {\n  if (e.message === 'Unsupported database type') {\n    showToast(`Inline editing is not supported for '${dbType}' databases`, true)\n  } else throw e\n}","preventionTips":["Use the legacy builder only for pre-existing dbexplorercomponent apps; new apps should use dbOps.ts (WM_INTERNAL_DB) which is type-agnostic server-side","Guard getUpdateInput/makeUpdateQuery call sites with the same supported-type check used elsewhere","Verify the database resource type before enabling inline cell editing in the UI","Track new DbType additions and update all legacy builders together"],"tags":["database","dbtable","update-query","legacy","frontend"],"backgroundTag":"unsupported-database-type","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}