windmill-labs/windmill · error
Unsupported database type:${dbType}
Error message
Unsupported database type:${dbType} What it means
makeCountQuery builds a frontend COUNT(*) query for the legacy Database Studio dbtable and switches on dbType to pick the right parameter/quicksearch syntax. When dbType matches none of the supported cases (mysql, postgresql, ms_sql_server, snowflake, bigquery, duckdb, etc.) the default branch throws. This guards against silently generating invalid SQL for a resource type the builder cannot handle.
Source
Thrown at frontend/src/lib/components/apps/components/display/dbtable/queries/count.ts:135
quicksearchCondition += `(@quicksearch = '' OR REGEXP_CONTAINS(CONCAT(${searchClause}), '(?i)' || @quicksearch))`
} else {
quicksearchCondition += `(@quicksearch = '' OR 1 = 1)`
}
query += `SELECT COUNT(*) as count FROM \`${table}\``
break
}
case 'duckdb':
if (filteredColumns.length > 0) {
quicksearchCondition += ` ($quicksearch = '' OR CONCAT(' ', ${duckdbQuicksearchColumns(
columnDefs
)}) LIKE CONCAT('%', $quicksearch, '%'))`
} else {
quicksearchCondition += ` ($quicksearch = '' OR 1 = 1)`
}
query += `SELECT COUNT(*) as count FROM ${table}`
break
default:
throw new Error('Unsupported database type:' + dbType)
}
if (whereClause) {
query += `${wherePrefix}${quicksearchCondition}`
} else {
query += dbType === 'ms_sql_server' && !whereClause ? wherePrefix : andCondition
query += quicksearchCondition
}
if (
!whereClause &&
(dbType === 'mysql' ||
dbType === 'postgresql' ||
dbType === 'snowflake' ||
dbType === 'bigquery' ||
dbType === 'duckdb')
) {
query = query.replace(`${andCondition}`, wherePrefix)View on GitHub (pinned to e474e8803c)
Solutions
- Check the dbType/resourceType of the database resource feeding the dbtable component and confirm it is one of the types in the switch (mysql, postgresql, ms_sql_server, snowflake, bigquery, duckdb).
- If using a ducklake input, ensure it is mapped to 'duckdb' before calling (getCountInput-style wrappers do `dbInput.type === 'ducklake' ? 'duckdb' : dbInput.resourceType`).
- If you added a new DB integration, extend the switch in makeCountQuery with its parameter-placeholder and quicksearch syntax, or use the new Database Manager (WM_INTERNAL_DB) path instead of this legacy builder.
- Log the incoming dbType at the call site (query) to see the exact offending value.
Example fix
// before
const dbType = dbInput.resourceType
const q = makeCountQuery(dbType, table, where, columns)
// after
const dbType = dbInput.type === 'ducklake' ? 'duckdb' : dbInput.resourceType
const SUPPORTED = ['mysql','postgresql','ms_sql_server','snowflake','bigquery','duckdb']
if (!SUPPORTED.includes(dbType)) throw new Error(`DB Studio table editor does not support ${dbType}`)
const q = makeCountQuery(dbType, table, where, columns) Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = ['mysql','postgresql','ms_sql_server','snowflake','bigquery','duckdb']
const dbType = dbInput.type === 'ducklake' ? 'duckdb' : dbInput.resourceType
if (!SUPPORTED.includes(dbType)) {
throw new Error(`Database Studio table editor does not support dbType "${dbType}"`)
} Type guard
function isSupportedDbType(t: string): t is DbType {
return ['mysql','postgresql','ms_sql_server','snowflake','bigquery','duckdb'].includes(t)
} Try / catch
try {
const q = makeCountQuery(dbType, table, where, columns)
} catch (e) {
if (String(e?.message).startsWith('Unsupported database type')) {
console.warn('dbtable count unsupported for', dbType)
return { count: 0 }
}
throw e
} Prevention
- Normalize ducklake inputs to 'duckdb' before any legacy query builder call
- Whitelist dbType against the switch cases before calling make*Query functions
- When adding a new DB integration, grep dbtable/queries/ for every switch to update
- Prefer the Database Manager (WM_INTERNAL_DB) path over legacy frontend builders
When it happens
Trigger: Calling makeCountQuery (via the dbtable query runner) with a dbType string outside the switch cases — e.g. a newly added resource type, a typo'd/legacy resourceType on the database resource, or a dbInput whose type was not normalized (such as 'ducklake' passed unmapped) before reaching this function.
Common situations: A new database integration was added to Windmill but this legacy query builder was not extended; a resource was created with an unusual/renamed type; a custom or copy-pasted app config references a resourceType the switch doesn't know; stale saved app state carries an old dbType value.
Related errors
- Unsupported database type
- Unsupported database type
- Unsupported database type: ${dbType}
- Cannot preview step of type '${moduleValue?.type ?? "unknown
- Column ${column.field} is not nullable and has no default va
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/6b1dad63aec28acd.
Report an issue: GitHub.