You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constSaveItem=SqlSchema.void({Request: S.Struct({jsonColumn: S.Struct({data: S.String})}),execute: (value)=>sql`INSERT INTO table ${sql.insert(value)} `,});
What is the expected behavior?
TS allows complex types in sql.insert (to be inserted into JSONB columns in postgres)
What do you see instead?
The insert actually works as expected, is just the Typechecking that fails with the following error:
No overload matches this call.
Overload 1 of 2, '(value: readonly Record<string, Primitive | Fragment | undefined>[]): RecordInsertHelper', gave the following error.
Argument of type '{ readonly jsonColumn: { readonly data: string; }; }' is not assignable to parameter of type 'readonly Record<string, Primitive | Fragment | undefined>[]'.
Type '{ readonly jsonColumn: { readonly data: string; }; }' is missing the following properties from type 'readonly Record<string, Primitive | Fragment | undefined>[]': length, concat, join, slice, and 20 more.
Overload 2 of 2, '(value: Record<string, Primitive | Fragment | undefined>): RecordInsertHelper', gave the following error.
Argument of type '{ readonly jsonColumn: { readonly data: string; }; }' is not assignable to parameter of type 'Record<string, Primitive | Fragment | undefined>'.
Property 'jsonColumn' is incompatible with index signature.
Type '{ readonly data: string; }' is not assignable to type 'Primitive | Fragment | undefined'.ts(2769)
Additional information
No response
The text was updated successfully, but these errors were encountered:
What version of Effect is running?
3.8.4
What steps can reproduce the bug?
What is the expected behavior?
TS allows complex types in sql.insert (to be inserted into JSONB columns in postgres)
What do you see instead?
The insert actually works as expected, is just the Typechecking that fails with the following error:
Additional information
No response
The text was updated successfully, but these errors were encountered: