Skip to content

D1_ERROR: NOT NULL constraint failed: recipes.id: SQLITE_CONSTRAINT #486

Closed as not planned
@Ombuweb

Description

@Ombuweb

Hi!

dizzleDB.insert produces the
D1_ERROR: NOT NULL constraint failed: recipes.id: SQLITE_CONSTRAINT despite having AUTOINCREMENT.

Below is the schema:

import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';

const columns = {
  id: integer('id').primaryKey({ autoIncrement: true }),
  name: text().notNull(),
  ingredients: text().notNull(),
  steps: text().notNull(),
  image: text().notNull(),
  notes: text().notNull(),
  tags: text(),
  user: text().notNull(),
  // createdAt: datetime({ mode: 'string' }).notNull(),
};
export const recipes = sqliteTable('recipes', columns);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions