Closed davidchalifoux closed 3 months ago
Thanks David, I'll try to reproduce this. Is count
a normal column of brand_locations
? Or a computed column etc.?
@soedirgo Thank you! No, it is not a normal or computed column.
It's actually happening to me with a much simpler query:
const res = await supabase
.from("brand_locations")
.select("count", { count: "estimated", head: true })
.eq("brand_id", brandId);
Again, it's returning SelectQueryError<"Referencing missing column
count">
.
I also tested it on other tables in my database, and it's happening with every one of them.
Could it be an issue with supabase gen types
?
EDIT: Nevermind, I forgot you don't need to select count if it's not a foreign table.
This is happening to me with this query:
const someQuery = await supabase
.from('someTable')
.select(
`id,
fk:foreign_key_id(id, name)
`
)
I believe it has to do with this pr
I've verified that my types file is correct, the column name
exists on the foreign table, and foreign_key_id
is configured as a foreign key to the table I expect it to be referencing(confirmed in types file). Also, at runtime, this works completely as expected with no issues.
I believe the expected behaviour is that fk
should be unknown
, or {}[]
? This works fine if I put *
instead of specifying columns. Not 100% sure on what the intended behavior is, or if my issue is directly related to this one. I'm just getting the same error, and they seem very similar
@soedirgo did you ever get a chance to test? Curious if this is intended behavior, or a bug
I have the same problem after upgrading. Also this seems to be a duplicate: https://github.com/supabase/postgrest-js/issues/449
:tada: This issue has been resolved in version 1.13.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Bug report
Describe the bug
After upgrading
@supabase/supabase-js
to2.26.0
, I'm now getting a type error when queryingcount
for a nested relationship. The API is returning the count exactly as before, so it's only a type issue.To Reproduce
count
of a nested relationship.Example query:
In this example,
brand_locations(count)
is what's causing the error. The returned type for that field isSelectQueryError
even though no error is thrown from the API.Expected behavior
The returned type of a
count
should not beSelectQueryError
.Screenshots
System information
v2.26.0
v18.17.0