-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
Description
Is your feature request related to a problem? Please describe.
I have a query like this:
/*
@name UpdateFoo
@param foos -> ((id, val)...)
*/
update foo f
set val = item.val
from (values :foos!) as item(id, val)
where f.id = item.id;foo.run({foos: [{id: 1, val: 100}, {id: 2, val: 200}]}, db)but this doesn't work because foos is inferred as:
export interface IUpdateFooParams {
foos: readonly ({
id: string,
val: string,
})[];
}And coercing the types in the set or where doesn't affect inference.
Describe the solution you'd like
Something similar to:
/*
@name UpdateFoo
@param foos -> ((id :: integer, val :: integer)...)
*/
update foo f
set val = item.val
from (values :foos!) as item(id, val)
where f.id = item.id;(or just set typescript types directly: @param foos -> ((id :: number, val :: number)...))
Additional context
Related, but not identical, to #395
Reactions are currently unavailable