{"record":{"id":"a97eaf228f9b9504","repo":"windmill-labs/windmill","slug":"unsupported-database-type-a97eaf","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/select.ts","lineNumber":319,"sourceCode":"      (CASE WHEN $order_by = '${column.field}' AND $is_desc IS false THEN \"${column.field}\"::text END),\n      (CASE WHEN $order_by = '${column.field}' AND $is_desc IS true THEN \"${column.field}\"::text END) DESC`\n\t\t\t\t)\n\t\t\t\t.join(',\\n')}`\n\n\t\t\tquicksearchCondition = `($quicksearch = '' OR CONCAT(${duckdbQuicksearchColumns(\n\t\t\t\tcolumnDefs\n\t\t\t)}) ILIKE '%' || $quicksearch || '%')`\n\n\t\t\tquery += `SELECT ${filteredColumns.join(', ')} FROM ${table}\\n`\n\t\t\tquery += ` WHERE ${whereClause ? `${whereClause} AND` : ''} ${quicksearchCondition}\\n`\n\t\t\tquery += ` ORDER BY ${orderBy}\\n`\n\t\t\tquery += ` LIMIT $limit::INT OFFSET $offset::INT`\n\n\t\t\tbreak\n\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error('Unsupported database type')\n\t}\n\n\treturn query\n}\n\nfunction coerceToNumber(value: any): number {\n\tif (typeof value === 'number') {\n\t\treturn value\n\t}\n\tif (typeof value === 'string') {\n\t\treturn parseInt(value, 10)\n\t}\n\treturn 0\n}\n\nexport function getSelectInput(\n\tdbInput: DbInput,\n\ttable: string | undefined,","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/apps/components/display/dbtable/queries/select.ts#L301-L337","documentation":"makeSelectQuery builds frontend-side SELECT SQL for the dbtable/Database Studio component and only supports postgresql, mysql, ms_sql_server, snowflake, bigquery and duckdb. If the dbType falls outside the switch (e.g. an undefined, renamed or not-yet-supported database type), the default arm throws 'Unsupported database type'. It is a configuration/dbType-guard, not a SQL error.","triggerScenarios":"Calling makeSelectQuery(table, columns, where, options, dbType) with a dbType that is not one of the six handled cases — typically dbType being undefined because the DbInput resource type was not resolved, or a newly added DbType (e.g. ducklake variants) that lacks a frontend case.","commonSituations":"A Database Studio app whose database resource type is new/exotic and has no frontend select builder; dbType derived from a resource that returns an unexpected string; upgrading Windmill where a new DbType was introduced before frontend support; a component wired with a stale/empty DbInput.","solutions":["Check the database input's resource type and switch to one of the supported types: postgresql, mysql, ms_sql_server, snowflake, bigquery, duckdb","Log/inspect the dbType value passed to makeSelectQuery — undefined usually means the DbInput failed to resolve; fix the component's database input binding","If a legitimately new backend DbType is missing, add a case to the switch in frontend/src/lib/components/apps/components/display/dbtable/queries/select.ts or migrate the app to the Database Manager (WM_INTERNAL_DB) path","Redeploy the app after changing the resource so the generated policy and queries are rebuilt"],"exampleFix":"// before\nmakeSelectQuery(table, columnDefs, where, options, dbType as DbType) // dbType may be undefined\n// after\nconst supported = ['postgresql','mysql','ms_sql_server','snowflake','bigquery','duckdb']\nif (!supported.includes(dbType)) throw new Error(`dbType '${dbType}' not supported by dbtable select`)\nmakeSelectQuery(table, columnDefs, where, options, dbType)","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['postgresql','mysql','ms_sql_server','snowflake','bigquery','duckdb']\nif (!SUPPORTED.includes(dbType)) {\n  throw new Error(`dbtable select does not support database type: ${dbType}`)\n}","typeGuard":"function isSupportedDbType(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 = makeSelectQuery(table, columnDefs, where, options, dbType)\n} catch (e) {\n  if (e.message === 'Unsupported database type') {\n    showToast(`Database type '${dbType}' is not supported for table display`, true)\n  } else throw e\n}","preventionTips":["Always resolve dbType from the DbInput resource before calling query builders; never pass it through when undefined","Keep the supported-type list centralized and share it with all select/update/alter builders","When adding a new backend DbType, search frontend dbtable queries/ for switches that need a case","Prefer the Database Manager (WM_INTERNAL_DB) path for new apps to avoid per-type frontend SQL builders"],"tags":["database","dbtable","unsupported-db-type","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"}