Closed digoburigo closed 1 year ago
Are you writing the types manually? Some of the fields are mandatory even though you have none of them. An empty schema looks like:
export type Json =
| string
| number
| boolean
| null
| { [key: string]: Json }
| Json[]
export interface Database {
public: {
Tables: {
[_ in never]: never
}
Views: {
[_ in never]: never
}
Functions: {
[_ in never]: never
}
Enums: {
[_ in never]: never
}
}
}
Oh ok, to make the types work properly I must use the supabase cli to generate the database types? I will try that to see. Thanks for the tip
Yeah, now I'm getting the autocompletion, but for some reason in the method select
it's only showing the *
to get all the fields, is there something more to configure? I pushed to the repo the change with the correct database type.
Hmm I don't think autocomplete is supposed to work in .select()
, but it should work for filters.
Oh ok, so the select
method don't have the autocompletion because of the vairous features provided by PosgREST? Thanks, Really apreciated the help! Feel free to close the issue
:+1: it's more to do with how the typings are implemented rather than what features PostgREST has
Bug report
Describe the bug
I'm trying to get the types of the database on postgrest client in a Nx monorepo and it's not working properly. I don't know if this is a NX problem or postgrest-js. Can someone help with this?
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
npm install
apps/pgrest/pages/index.tsx
Expected behavior
Autocomplete based on the Database type
Screenshots
System information