pg-meta – an internal helper service for the database
When you use the dashboard to create a new table or add some more columns to a table, you would think that this is done via PostgREST, right? Well, PostgREST is built for data management, not database management.
Instead, database management is the task of the pg-meta service. It is a REST API that allows all kinds of manipulations on the database that is used by the other Supabase services. For example, when you create a new table with Studio, it talks to the pg-meta service by making a POST Request to /pg-meta/tables
. It is secured and only accessible for the internal services or admins (e.g., when you log in to Studio, you are an admin).
However, why is pg-meta needed when all the services in the Supabase stack could also access the database directly? The following are some key reasons:
- It abstracts away any underlying changes. In theory, you could even completely replace the database with a different database...