supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
964 stars 128 forks source link

ParserError: Expected identifier at `)` when using relation with no columns selected #445

Closed vladshcherbin closed 4 months ago

vladshcherbin commented 11 months ago

Bug report

Describe the bug

When using anti-join and not selecting any columns, ParserError is shown.

Query:

await supabase
  .from('cars')
  .select('id, car_images()')
  .is('car_images', null)

Error:

image

The query is working and returns correct results, only typescript is showing this error with no types as a result. After adding any field (for example car_images(id)) the error disappears and typings are correct.

Article with similar example (nominations relation): https://supabase.com/blog/postgrest-11-prerelease#anti-joins

Expected behavior

No typescript typings error, return type should not have this relation.

Screenshots

image

System information

soedirgo commented 11 months ago

Thanks @vladshcherbin! This is a new feature from PostgREST v11 (using nested() in v10 would result in an error), so flagging this as a feature request.

github-actions[bot] commented 4 months ago

:tada: This issue has been resolved in version 1.12.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: