This MySQL table
CREATE TABLE `Foo` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`firstName` varchar(255) NOT NULL DEFAULT '',
`lastName` varchar(255) NOT NULL DEFAULT '',
`fullName` varchar(255) GENERATED ALWAYS AS (concat(`firstName`, ' ',`lastName`)) STORED NOT NULL
);
leads to these types
export interface Foo {
id: Generated<number>
firstName: Generated<string>
lastName: Generated<string>
fullName: string
}
This causes issues when trying
db.insertInto("Foo").values({
firstName: "foo",
lastName: "bar"
})
Property 'fullName' is missing in type '{ firstName: string; lastName: string; }' but required in type '{ fullName: ValueExpression<DB, "Foo", string>; }'.ts(2345)
I believe fullName
should be typed Generated<string>
, shouldn't it? 🤔
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too