Functions

get-pooler-config

fn (project-ref: Str): Vec

Get the current Supavisor connection pooler configuration.

get-postgres-config

fn (project-ref: Str): Map

Get the Postgres configuration for a project (statement_timeout, max_connections, etc.).

Example

::databases ::supabase::admin::databases

config ::databases/get-postgres-config("my-project-ref")

get-readonly-mode

fn (project-ref: Str): Map

Check if the project database is in read-only mode.

get-upgrade-status

fn (project-ref: Str): Map

Get the current database upgrade status.

list-available-versions

fn (project-ref: Str): Map

List available Postgres versions for upgrade.

list-backups

fn (project-ref: Str): Vec

List database backups for a project.

Example

::databases ::supabase::admin::databases

backups ::databases/list-backups("my-project-ref")
// => [{id: "...", status: "COMPLETED", created_at: "...", ...}, ...]

list-migrations

fn (project-ref: Str): Vec

List database migrations that have been run on a project.

list-read-replicas

fn (project-ref: Str): Vec

List read replicas for a project.

ns alias

Alias of ::supabase::admin::databases/

pooler-path

fn (project-ref: Str): Str

run-query

fn (request: RunQueryRequest): Any

Run a SQL query against a project's database. Requires a Personal Access Token with appropriate permissions.

Example

::databases ::supabase::admin::databases

result ::databases/run-query(::databases/RunQueryRequest({
  project_ref: "my-project-ref",
  query: "SELECT count(*) FROM auth.users"
}))

update-pooler-config

fn (project-ref: Str, config: Map): Map

Update the Supavisor connection pooler configuration.

update-postgres-config

fn (project-ref: Str, config: Map): Map

Update Postgres configuration. Pass a Map of config fields (e.g. {statement_timeout: "30s", max_connections: 200}).

upgrade-eligibility-path

fn (project-ref: Str): Str

Types

Backup

Backup type {
    id: Str?,
    status: Str?,
    created_at: Str?
}

Migration

Migration type {
    version: Str?,
    name: Str?,
    inserted_at: Str?
}

RunQueryRequest

RunQueryRequest type {
    project_ref: Str,
    query: Str
}