I want my users to be able to upload reports (PDFs). For this purpose, I have created a table of "reports" and thought that I can reference the object stored there. Therefore I created a column "file" with the foreign key reference to the object store.
This has worked so far, however, I do not get a query to work. Example:
const { data } = await supabase
.from<definitions["reports"]>("reports")
.throwOnError()
.select(`id,title,file(id)`);
The above example gives me this error:
{
"code":"PGRST200",
"details":null,
"hint":"Verify that 'reports' and 'file' exist in the schema 'public' and that there is a foreign key relationship between them. If a new relationship was created, try reloading the schema cache.",
"message":"Could not find a relationship between 'reports' and 'file' in the schema cache"
}
I'm only recently working with Postgres and so I would imagine that a reference across the tables and the files may simply not be possible. Anyway, I would like to know how else I could implement this use case.
Many thanks