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
constuser={firstName: firstName,lastName: lastName,userName: userName,password: hashedPassword,};constcolumns=["firstName","lastName","userName","password"];constres=awaitsql`insert into users ${sql(user,columns)}`;//error on "${sql(user, columns)}"
This code gives a No overload matches this call
No overload matches this call.
Argument of type '[Helper<{ firstName: any; lastName: any; userName: any; password: any; }, readonly ("firstName" | "lastName" | "userName" | "password")[]>]' is not assignable to parameter of type 'never'.
Overload 2 of 2, '(template: TemplateStringsArray, ...parameters: readonly ParameterOrFragment<never>[]): PendingQuery<Row[]>', gave the following error.
Argument of type 'Helper<{ firstName: any; lastName: any; userName: any; password: any; }, readonly ("firstName" | "lastName" | "userName" | "password")[]>' is not assignable to parameter of type 'ParameterOrFragment<never>'.
Type 'Helper<{ firstName: any; lastName: any; userName: any; password: any; }, readonly ("firstName" | "lastName" | "userName" | "password")[]>' is not assignable to type 'Helper<any, any[]>'.
The type 'readonly ("firstName" | "lastName" | "userName" | "password")[]' is 'readonly' and cannot be assigned to the mutable type 'any[]'.ts(2769)
No overload matches this call.
Overload 1 of 2, '(first: { firstName: any; lastName: any; userName: any; password: any; }, ...rest: readonly ("firstName" | "lastName" | "userName" | "password")[]): Helper<{ firstName: any; lastName: any; userName: any; password: any; }, readonly ("firstName" | ... 2 more ... | "password")[]>', gave the following error.
Argument of type 'string[]' is not assignable to parameter of type '"firstName" | "lastName" | "userName" | "password"'.
Overload 2 of 2, '(template: TemplateStringsArray, ...parameters: readonly ParameterOrFragment<never>[]): PendingQuery<Row[]>', gave the following error.
Argument of type '{ firstName: any; lastName: any; userName: any; password: any; }' is not assignable to parameter of type 'TemplateStringsArray'.
Type '{ firstName: any; lastName: any; userName: any; password: any; }' is missing the following properties from type 'TemplateStringsArray': raw, length, concat, join, and 27 more.ts(2769)
const user: {
firstName: any;
lastName: any;
userName: any;
password: any;
}
The code above still works though and will still insert into the database.
Kinda confused on how to proceed, following the guide here in dynamic inserts on the docs.
The text was updated successfully, but these errors were encountered:
This code gives a
No overload matches this call
The code above still works though and will still insert into the database.
Kinda confused on how to proceed, following the guide here in dynamic inserts on the docs.
The text was updated successfully, but these errors were encountered: