Proper way to infer update model?

Currently I infer update model by partial of InferInsertModel which work fine, but in case of updating value with sql`` this error happended.
No description
No description
3 Replies
TOSL
TOSL4w ago
If you check the type of Drizzle's sql function you'll see, this:
function sql<T>(strings: TemplateStringsArray, ...params: any[]): SQL<T>
(alias) namespace sql
function sql<T>(strings: TemplateStringsArray, ...params: any[]): SQL<T>
(alias) namespace sql
You can see that you will accept sql<T> so you can do this:
sql<number>`${customerPoint.point}`
sql<number>`${customerPoint.point}`
Little Cutie Penguin 🐧
I tried, but same result as InferInsertModel doesn't accept sql<T> type
No description
No description
TOSL
TOSL4w ago
Can you post the actual code here

Did you find this page helpful?