customType generate type with double quotes

any solution for this?
export const identity = (name: string) => customType<{
data: number
notNull: true
default: true
}>({
dataType() {
return 'INTEGER GENERATED ALWAYS AS IDENTITY'
},
})(name)
export const identity = (name: string) => customType<{
data: number
notNull: true
default: true
}>({
dataType() {
return 'INTEGER GENERATED ALWAYS AS IDENTITY'
},
})(name)
generate this code:
"id" "INTEGER GENERATED ALWAYS AS IDENTITY" PRIMARY KEY NOT NULL,
"id" "INTEGER GENERATED ALWAYS AS IDENTITY" PRIMARY KEY NOT NULL,
1 Reply
Mykhailo
Mykhailo11mo ago
Hello, @goodboy04289! If you use customType you should provide the name of type in dataType return statement. For example, integer. GENERATED ALWAYS AS IDENTITY is not part of type name, so you can't use it here. As for now, Drizzle doesn't have native support for Generated columns, but there is PR which will add it https://github.com/drizzle-team/drizzle-orm/pull/1471
GitHub
Feat: Drizzle-ORM support for Generated columns by Angelelz · Pull ...
This PR will close #261, will close #579 and will close #1464. The API for generated columns will look like this: const users = sqliteTable( 'users', { id: int('id').primary...
Want results from more Discord servers?
Add your server