Describe the bug
When I use a json path in select() the type inference produces non nullable types even when the return type might be null.
To Reproduce
- Create a table with a column
json_col that can be null and override the database type to be { a: string } | null
- Create a query with
.select('json_col->a')
- Return type will be { a: string }
Expected behavior
This query will actually return `{ a: null } when the column is null. This should be reflected in the type.
This should be the case when the column is nullable or when one of the properties along the path is nullable.
I currently only have this type safety when I do
const { data } = ...select('json_col');
data!.json_col.a; // Object is possibly 'null'.
Describe the bug
When I use a json path in
select()the type inference produces non nullable types even when the return type might be null.To Reproduce
json_colthat can be null and override the database type to be{ a: string } | null.select('json_col->a')Expected behavior
This query will actually return `{ a: null } when the column is null. This should be reflected in the type.
This should be the case when the column is nullable or when one of the properties along the path is nullable.
I currently only have this type safety when I do