array of number returning strings

Hey, I've defined an array of number in my schema:
price: numeric('price', { precision: 10 }).array()
price: numeric('price', { precision: 10 }).array()
The problem is that when I retrieve the value, it's actually typed as an array of string: price: string[] How comes? How can I get the right type? (number[]) When I hover on the column declaration on my schema, it shows this: see capture Why is the data: string[]?
No description
1 Reply
Janick
Janick2mo ago
The solution was to add this to my schema definition:
price: numeric('price', { precision: 10, scale: 0 })
.array()
.$type<number[]>(),
price: numeric('price', { precision: 10, scale: 0 })
.array()
.$type<number[]>(),
Want results from more Discord servers?
Add your server