Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript support for undefined values #855

Closed
sambecker opened this issue Apr 30, 2024 · 0 comments
Closed

TypeScript support for undefined values #855

sambecker opened this issue Apr 30, 2024 · 0 comments

Comments

@sambecker
Copy link

In order to accept undefined in queries, I've applied the following configuration:

export const sql = postgres(process.env.POSTGRES_URL, {
  transform: { undefined: null },
});

But then TypeScript says its usage is not valid:

// TS Error: 'ParameterOrFragment<never>'.ts(2769)
sql`UPDATE table SET field=${undefined} WHERE id=${1}`

Is there a recommended approach to loosen the types?

Repository owner locked and limited conversation to collaborators May 15, 2024
@porsager porsager converted this issue into discussion #868 May 15, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants