{"record":{"id":"573dc3fb66e8f9a6","repo":"windmill-labs/windmill","slug":"unsupported-database-type","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/delete.ts","lineNumber":74,"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 += `\\nDELETE FROM ${table} \\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 += `\\nDELETE FROM ${table} \\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 getDeleteInput(\n\tdbInput: DbInput,\n\ttable: string,\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 = makeDeleteQuery(table, columns, dbType)\n\tif (dbInput.type === 'ducklake') query = wrapDucklakeQuery(query, dbInput.ducklake)","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/apps/components/display/dbtable/queries/delete.ts#L56-L92","documentation":"makeDeleteQuery builds a frontend DELETE statement and switches on dbType to choose parameter placeholders and identity-column handling. The default branch throws 'Unsupported database type' when dbType is not one of the explicitly supported database kinds. It prevents generating a DELETE query with placeholder syntax the target database cannot parse.","triggerScenarios":"Calling makeDeleteQuery with a dbType other than mysql, postgresql, ms_sql_server, snowflake, bigquery, or duckdb — e.g. a resource type added later that this builder predates, an unmapped 'ducklake' input, or corrupted saved app state with an unknown type string.","commonSituations":"New DB integration added to the platform without updating this legacy builder; database resource configured with an unexpected/renamed resourceType; legacy Database Studio app pointed at a resource type it was never built for.","solutions":["Verify the database resource's resourceType is one supported by the delete builder's switch.","Map ducklake inputs to 'duckdb' before calling (as getDeleteInput-style wrappers do).","Extend the switch with the new dbType's placeholder syntax if you own the code that added the new integration.","Prefer the newer Database Manager path (WM_INTERNAL_DB markers expanded server-side) over this legacy frontend builder."],"exampleFix":"// before\nconst q = makeDeleteQuery(table, pkColumns, dbInput.resourceType)\n// after\nconst dbType = dbInput.type === 'ducklake' ? 'duckdb' : dbInput.resourceType\nconst q = makeDeleteQuery(table, pkColumns, dbType)","handlingStrategy":"validation","validationCode":"const dbType = dbInput.type === 'ducklake' ? 'duckdb' : dbInput.resourceType\nif (!['mysql','postgresql','ms_sql_server','snowflake','bigquery','duckdb'].includes(dbType)) {\n  return null // delete not supported for this database\n}","typeGuard":"const isDeletableDbType = (t: unknown): t is DbType =>\n  typeof t === 'string' && ['mysql','postgresql','ms_sql_server','snowflake','bigquery','duckdb'].includes(t)","tryCatchPattern":"try {\n  return makeDeleteQuery(table, pkColumns, dbType)\n} catch (e) {\n  if (e instanceof Error && e.message === 'Unsupported database type') {\n    showToast('Deletes are not supported for this database type')\n    return null\n  }\n  throw e\n}","preventionTips":["Check resourceType on the database resource when configuring the app","Normalize ducklake to 'duckdb' before calling builders","Keep a shared SUPPORTED_DB_TYPES constant instead of repeating the switch","Hide destructive (delete) UI for unsupported dbTypes"],"tags":["database","sql-generation","unsupported-type","legacy-code"],"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"}