4 ms·
Going to mention postgrest a bit, which the article also mentioned via supabase. > We wanted to make schema changes on the back-end, but the front-end queries
by SahAssar 5y ago
Going to mention postgrest a bit, which the article also mentioned via supabase.
> We wanted to make schema changes on the back-end, but the front-end queries were tied to it.
The recommended way is to expose SQL views, that way you can modify the tables as long as what you return is compatible.
> What was our API, and where did it end? Now it was the entire database!
With postgrest the api is the schema you expose. That can be the raw tables, it can be views, it can be SQL functions. You get an openAPI definition for how to use it and what is in it. I like that.
> it gets kind of weird if you want to map upsert onto REST
Is upsert not just a PUT? Or do you mean if you have generated paths like /article/{id} and generate the id serverside but still want to upsert from the client?