{"id":"d69a5fef43238597","repo":"drizzle-team/drizzle-orm","slug":"method-not-implemented-d69a5f","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-orm/src/singlestore-core/columns/datetime.ts","lineNumber":34,"sourceCode":"\tname: TName;\n\tdataType: 'date';\n\tcolumnType: 'SingleStoreDateTime';\n\tdata: Date;\n\tdriverParam: string | number;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class SingleStoreDateTimeBuilder<T extends ColumnBuilderBaseConfig<'date', 'SingleStoreDateTime'>>\n\textends SingleStoreColumnBuilder<T, SingleStoreDatetimeConfig>\n{\n\t/** @internal */\n\t// TODO: we need to add a proper support for SingleStore\n\toverride generatedAlwaysAs(\n\t\t_as: SQL<unknown> | (() => SQL) | T['data'],\n\t\t_config?: Partial<GeneratedColumnConfig<unknown>>,\n\t): HasGenerated<this, {}> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tstatic override readonly [entityKind]: string = 'SingleStoreDateTimeBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'date', 'SingleStoreDateTime');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreDateTime<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SingleStoreDateTime<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-orm/src/singlestore-core/columns/datetime.ts#L16-L52","documentation":"SingleStoreDateTimeBuilder.generatedAlwaysAs() throws 'Method not implemented.' with an explicit TODO: 'we need to add a proper support for SingleStore'. Generated/computed columns are not yet wired up for SingleStore's datetime column type, so calling generatedAlwaysAs on it is intentionally a hard fail rather than producing invalid DDL.","triggerScenarios":"Defining a SingleStore datetime column with .generatedAlwaysAs(sql`...`) or .generatedAlwaysAs(() => sql`...`) in a schema: datetime('created_at').generatedAlwaysAs(sql`CURRENT_TIMESTAMP`).","commonSituations":"Porting a MySQL/Postgres Drizzle schema that uses generated datetime columns to SingleStore. Auto-generating schemas from existing SingleStore databases that have computed datetime columns.","solutions":["Avoid generatedAlwaysAs on SingleStore datetime columns; manage the value in application code (set on insert) or via a DEFAULT clause using .default(sql`CURRENT_TIMESTAMP`).","Use a different column type for which generatedAlwaysAs is implemented, if the computed value is numeric/string.","Track the SingleStore support TODO and update once implemented; until then do not rely on generated datetime columns."],"exampleFix":"// before (throws - not implemented for SingleStore datetime)\nexport const t = singlestoreTable('t', {\n  createdAt: datetime('created_at').generatedAlwaysAs(sql`CURRENT_TIMESTAMP`),\n});\n\n// after (use default instead)\nexport const t = singlestoreTable('t', {\n  createdAt: datetime('created_at').default(sql`CURRENT_TIMESTAMP`),\n});","handlingStrategy":"type-guard","validationCode":"// Do not call generatedAlwaysAs on SingleStore datetime columns.\nimport { entityKind } from 'drizzle-orm/entity';\n\nfunction isSingleStoreDateTimeBuilder(b: any): boolean {\n  return b?.[entityKind] === 'SingleStoreDateTimeBuilder';\n}\n\n// In schema code, branch away from generatedAlwaysAs when the builder is a\n// SingleStore datetime builder; use .default(sql`...`) instead.","typeGuard":"function isSingleStoreDateTimeColumnBuilder(b: unknown): boolean {\n  return (b as any)?.[Symbol.for('drizzle:entityKind')] === 'SingleStoreDateTimeBuilder';\n}","tryCatchPattern":"try {\n  const col = datetime('created_at').generatedAlwaysAs(sql`CURRENT_TIMESTAMP`);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Method not implemented.') {\n    const col = datetime('created_at').default(sql`CURRENT_TIMESTAMP`);\n  } else throw e;\n}","preventionTips":["Avoid generatedAlwaysAs on SingleStore datetime columns; use .default(sql`...`).","When porting schemas from MySQL/Postgres, audit generated datetime columns and convert to defaults.","Track the upstream TODO until SingleStore generated-column support ships."],"tags":["singlestore","datetime","generated-columns","not-implemented","schema"],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}