{"record":{"id":"d2229c09391b5f97","repo":"mastra-ai/mastra","slug":"unsupported-database-kind-kind-supported-kind","errorCode":null,"errorMessage":"Unsupported database kind: ${kind}. Supported kinds: turso, neon, redis","messagePattern":"Unsupported database kind: (.+?)\\. Supported kinds: turso, neon, redis","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/db/db.ts","lineNumber":284,"sourceCode":"    console.info(`    Scope: ${formatScope(db, environments)}`);\n    if (db.region) {\n      console.info(`    Region: ${db.region}`);\n    }\n    console.info(`    Env vars: ${envVarNamesFor(db.kind)}`);\n    if (db.error) {\n      console.info(`    Error: ${db.error}`);\n    }\n  }\n  console.info('');\n}\n\n/* ------------------------------------------------------------------ */\n/*  mastra env db create                                               */\n/* ------------------------------------------------------------------ */\n\nfunction parseKind(kind: string): DatabaseKind {\n  if (kind !== 'turso' && kind !== 'neon' && kind !== 'redis') {\n    throw new Error(`Unsupported database kind: ${kind}. Supported kinds: turso, neon, redis`);\n  }\n  return kind;\n}\n\nasync function createDatabaseAction(\n  envArg: string | undefined,\n  options: {\n    project?: string;\n    kind: string;\n    name?: string;\n    region?: string;\n    shared?: boolean;\n    wait: boolean;\n    json?: boolean;\n  },\n) {\n  const kind = parseKind(options.kind);\n","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/db/db.ts#L266-L302","documentation":"parseKind() whitelists the --kind option to 'turso', 'neon', or 'redis' before creating a database; any other value is rejected with the supported list. This is a deterministic input constraint enforced up front in createDatabaseAction.","triggerScenarios":"`mastra env db create ... --kind postgres` (or any value outside turso|neon|redis), including casing variants like 'Turso'.","commonSituations":"Assuming other engines (Postgres, MongoDB, SQLite) are supported, capitalizing the kind, or copying an outdated example from docs/CI scripts.","solutions":["Use one of the supported kinds exactly: --kind turso, --kind neon, or --kind redis (all lowercase).","If you need a different engine, it is not supported by this command; check the Mastra Cloud docs for current supported database kinds.","Fix CI scripts/deployment configs that pass an unsupported --kind value."],"exampleFix":"// before\nmastra env db create prod --kind postgres\n// after\nmastra env db create prod --kind neon","handlingStrategy":"validation","validationCode":"const KINDS = ['turso', 'neon', 'redis'] as const;\ntype Kind = typeof KINDS[number];\nif (!KINDS.includes(kind as Kind)) {\n  throw new Error(`--kind must be one of ${KINDS.join(', ')}, got: ${kind}`);\n}","typeGuard":"function isDatabaseKind(v: string): v is 'turso' | 'neon' | 'redis' {\n  return v === 'turso' || v === 'neon' || v === 'redis';\n}","tryCatchPattern":"try {\n  await createDatabase({ kind });\n} catch (e) {\n  if (/Unsupported database kind/.test((e as Error).message)) {\n    console.error('Use --kind turso | neon | redis (lowercase).');\n  }\n}","preventionTips":["Keep the kind literal and lowercase in scripts/configs.","Type the kind as the union 'turso' | 'neon' | 'redis' in wrapper code.","Check current docs before assuming new engines are supported."],"tags":["cli","validation","argument","database"],"backgroundTag":"invalid-enum-value","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}