3 ms·
There are python clients available[1]. For example with postgrest-py[2] you can do: async with PostgrestClient("http://<yourhost>.com") as client:
by steve-chavez 5y ago
There are python clients available[1]. For example with postgrest-py[2] you can do:
async with PostgrestClient("http://<yourhost>.com") as client:
r = await client.from_("countries").select("*").execute()
countries = r.json()
One advantage is that you don't have to worry about handling raw postgresql connections or pooling(as PostgREST does that for you), you only do HTTP requests. And if you want more complex SQL you can create functions or views.
[1]: https://postgrest.org/en/v9.0/ecosystem.html#client-side-libraries https://postgrest.org/en/v9.0/ecosystem.html#client-side-lib...
[2]: https://github.com/supabase-community/postgrest-py https://github.com/supabase-community/postgrest-py