Yuya
Yuya
DTDrizzle Team
Created by Yuya on 3/14/2025 in #help
TypeError for nullable/optional fields
i'm facing the same problem in this github issue https://github.com/drizzle-team/drizzle-orm/issues/4219
2 replies
DTDrizzle Team
Created by Yuya on 2/7/2025 in #help
TypeError unless column is notNull
gave the following error. Object literal may only specify known properties, and <column> does not exist in type: schema.ts:
export const usersSchema = sqliteTable('users', {
id: int().primaryKey({ autoIncrement: true }),
name: text().notNull(),
email: text().notNull().unique(),
verified: int().notNull(),
columnWithError: text(),
});
export const usersSchema = sqliteTable('users', {
id: int().primaryKey({ autoIncrement: true }),
name: text().notNull(),
email: text().notNull().unique(),
verified: int().notNull(),
columnWithError: text(),
});
const user = await db
.insert(usersSchema)
.values({
name: '',
email,
passwordHash,
verified: 0,
columnWithError, // NOT READ FOR SOME REASON
})
const user = await db
.insert(usersSchema)
.values({
name: '',
email,
passwordHash,
verified: 0,
columnWithError, // NOT READ FOR SOME REASON
})
Once I add the .notNull() the error is gone, am I doning something wrong? Thanks.
5 replies