Skip to content
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

SQL string template expansion support #237

Closed
jadbox opened this issue Apr 22, 2021 · 1 comment
Closed

SQL string template expansion support #237

jadbox opened this issue Apr 22, 2021 · 1 comment

Comments

@jadbox
Copy link

jadbox commented Apr 22, 2021

The NPM library postgres has a really nice feature to do string template expansions, can read about it here:
https://github.com/porsager/postgres

For example:

const users = await sql`
  select 
    * 
  from users
  where age in (${ [68, 75, 23] })
`

In theory, pgtyped, should be able to do something just like this too, and it would help with general ease of development.

@adelsz
Copy link
Owner

adelsz commented May 1, 2021

Unfortunately, this would make PG type inference impossible. Related #233

@adelsz adelsz closed this as completed May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants