{"record":{"id":"29a8624dac166091","repo":"windmill-labs/windmill","slug":"unsupported-database-type-dbtype","errorCode":null,"errorMessage":"Unsupported database type: ${dbType}","messagePattern":"Unsupported database type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/apps/components/display/dbtable/queries/alterTable.ts","lineNumber":211,"sourceCode":"function renderAlterDatatype(\n\ttableRef: string,\n\tcolumnName: string,\n\tdatatype: string,\n\tdbType: DbType\n): string {\n\tswitch (dbType) {\n\t\tcase 'postgresql':\n\t\tcase 'duckdb':\n\t\t\treturn `ALTER TABLE ${tableRef} ALTER COLUMN ${columnName} TYPE ${datatype};`\n\t\tcase 'ms_sql_server':\n\t\t\treturn `ALTER TABLE ${tableRef} ALTER COLUMN ${columnName} ${datatype};`\n\t\tcase 'mysql':\n\t\t\treturn `ALTER TABLE ${tableRef} MODIFY COLUMN ${columnName} ${datatype};`\n\t\tcase 'snowflake':\n\t\tcase 'bigquery':\n\t\t\treturn `ALTER TABLE ${tableRef} ALTER COLUMN ${columnName} SET DATA TYPE ${datatype};`\n\t\tdefault:\n\t\t\tthrow new Error(`Unsupported database type: ${dbType}`)\n\t}\n}\n\nfunction renderDropDefaultValue(\n\ttableRef: string,\n\tcolumnName: string,\n\tdatatype: string,\n\tdbType: DbType,\n\tdefaultConstraintName?: string\n): string {\n\tswitch (dbType) {\n\t\tcase 'postgresql':\n\t\tcase 'duckdb':\n\t\tcase 'mysql':\n\t\tcase 'snowflake':\n\t\tcase 'bigquery':\n\t\t\treturn `ALTER TABLE ${tableRef} ALTER COLUMN ${columnName} DROP DEFAULT;`\n\t\tcase 'ms_sql_server':","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/apps/components/display/dbtable/queries/alterTable.ts#L193-L229","documentation":"renderAlterDatatype() renders the ALTER statement that changes a column's data type for the target database. It handles mysql, postgresql (implied earlier cases), snowflake and bigquery; any other DbType reaches the default branch and throws 'Unsupported database type'.","triggerScenarios":"Editing a column's datatype in the dbtable editor connected to a database whose dbType is not handled for datatype alters — e.g. ms_sql_server, duckdb, or any new DbType value added to the union without a case here.","commonSituations":"Using the table editor against MS SQL Server, where type changes require a different strategy; a newly supported database type in Windmill lacking an alter-datatype implementation; a dbType string mismatch (typo/custom value) coming from resource configuration.","solutions":["Check the connected resource's database type; if unhandled (e.g. ms_sql_server), change the datatype via manual SQL instead of the table editor.","If developing: add a case for the missing dbType with its vendor-specific ALTER syntax.","Confirm the resource type field matches a supported DbType value (no typos/custom values).","Pre-validate in the UI: disable/hide datatype editing for dbTypes this renderer does not support."],"exampleFix":"// before\ndefault:\n  throw new Error(`Unsupported database type: ${dbType}`)\n// after\ncase 'ms_sql_server':\n  return `ALTER TABLE ${tableRef} ALTER COLUMN ${columnName} ${datatype};`\ndefault:\n  throw new Error(`Unsupported database type: ${dbType}`)","handlingStrategy":"validation","validationCode":"const supportedDatatypeAlter = ['postgresql','mysql','snowflake','bigquery'] // plus whatever renderAlterDatatype covers\nif (!supportedDatatypeAlter.includes(dbType)) {\n  // disable datatype editing or fall back to manual SQL\n}","typeGuard":"function supportsAlterDatatype(dbType: DbType): boolean {\n  return ['postgresql','mysql','snowflake','bigquery'].includes(dbType)\n}","tryCatchPattern":"try {\n  return renderAlterDatatype(tableRef, columnName, datatype, dbType)\n} catch (e) {\n  if (String(e).includes('Unsupported database type')) {\n    return fallbackManualSql(tableRef, columnName, datatype, dbType)\n  }\n  throw e\n}","preventionTips":["Check dialect support in the table editor UI before offering datatype edits.","When adding a new DbType to the union, extend every render* helper in alterTable.ts in the same PR.","Match the resource type against supported values before running schema edits."],"tags":["frontend","sql","dbtable","database-compatibility"],"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"}