Graeme
Graeme
DTDrizzle Team
Created by Graeme on 7/11/2023 in #help
ERR_PACKAGE_PATH_NOT_EXPORTED on 0.27.1
No description
4 replies
DTDrizzle Team
Created by Graeme on 6/27/2023 in #help
Unexpected type mismatch for sqlite integer boolean mode
Hi, you guys added boolean support for sqlite recently (thanks for that!!). It correctly expects 0 and 1 as the values in the db but I've noticed when using a default(0) it throws a ts error (see below). Setting it as a boolean default(false) does not. I'd expect to set a value in line with the expectation but perhaps my understanding is wrong? Is it a bug?
export const foo = sqliteTable("foo", {
isFooBar: integer("is_foo_bar", { mode: "boolean" })
.notNull()
.default(0)
// ^ Argument of type '0' is not assignable to parameter of type 'boolean | SQL<unknown>'.ts(2345)
});
export const foo = sqliteTable("foo", {
isFooBar: integer("is_foo_bar", { mode: "boolean" })
.notNull()
.default(0)
// ^ Argument of type '0' is not assignable to parameter of type 'boolean | SQL<unknown>'.ts(2345)
});
9 replies