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

Type inference issues in the Postgres engine #375

Open
adelsz opened this issue Dec 4, 2021 · 1 comment
Open

Type inference issues in the Postgres engine #375

adelsz opened this issue Dec 4, 2021 · 1 comment

Comments

@adelsz
Copy link
Owner

adelsz commented Dec 4, 2021

This is a meta issue to track all type inference issues occurring inside the PostgreSQL engine.
At this stage we can't solve them inside pgTyped without building a more powerful SQL parser.
Ideally they should be fixed inside PostgreSQL.

Issues:

@petetnt
Copy link

petetnt commented Apr 27, 2023

Another possible meta issue, literal column values end up being type | null.

select id, 'foo' as foovalue, 1 as barvalue from 'bar';

Result:

type Bar = {
  id: number
  foovalue: string | null
  barvalue: number | null
}

Expected:

type Bar = {
  id: number
  foovalue: string
  barvalue: number
}

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