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
I am getting what appears to be inconsistent TypeScript errors when writing dynamic insert queries:
Issue
// No errors:constusers=awaitsql<UserDto[]>`INSERT INTO users ${sql(payload)} returning *`;// orconsthelper=sql(payload,"username","email","password");constusers=awaitsql<UserDto[]>`INSERT INTO users ${helper} returning *`;// Error: Type of operand must either be a valid promise or must not contain a callable then member.constusers=awaitsql<UserDto[]>`INSERT INTO users ${sql(payload,"username","email","password")} returning *`;
Expected
I would expect all three above to be valid but the last one throws a TypeScript error.
I am getting what appears to be inconsistent TypeScript errors when writing dynamic insert queries:
Issue
Expected
I would expect all three above to be valid but the last one throws a TypeScript error.
Is this the intended behavior?
tsconfig
The text was updated successfully, but these errors were encountered: