turbot/supabase
steampipe plugin install supabase

Table: supabase_function - Query Supabase Functions using SQL

Supabase Functions are user-defined operations that extend the capabilities of a Supabase database. These functions can be used to perform operations that would normally require multiple queries and round trips in a single call. They are stored in the database and can be invoked using the SQL language.

Table Usage Guide

The supabase_function table provides insights into user-defined functions within a Supabase database. As a database administrator or developer, you can explore function-specific details through this table, including the function's name, schema, data type, and source code. Use it to uncover information about functions, such as their implementation, dependencies, and usage, to help optimize database operations and performance.

Examples

Basic info

Explore the status and version of various functions within your Supabase environment. This can be useful to keep track of function updates and monitor their operational status.

select
name,
slug,
status,
version
from
supabase_function;
select
name,
slug,
status,
version
from
supabase_function;

List throttled functions

Identify instances where certain functions have been throttled or limited in their operations. This can help in diagnosing performance issues and maintaining optimal functionality.

select
name,
slug,
status,
version
from
supabase_function
where
status = 'THROTTLED';
select
name,
slug,
status,
version
from
supabase_function
where
status = 'THROTTLED';

List functions with JWT verification enabled

Determine the areas in which JWT verification is enabled for various functions. This is useful for ensuring security measures are in place across your functions.

select
name,
slug,
status,
version
from
supabase_function
where
verify_jwt;
select
name,
slug,
status,
version
from
supabase_function
where
verify_jwt;

List functions not updated in last 30 days

Discover the functions that have not been updated in the past 30 days. This is useful to identify areas that may require attention or updates to ensure optimal performance and security.

select
name,
slug,
status,
version,
project_id
from
supabase_function
where
updated_at < (current_date - interval '30 days');
select
name,
slug,
status,
version,
project_id
from
supabase_function
where
updated_at < date('now', '-30 day');

Get a specific function

Explore the status and version of a specific function within a given project. This can help in tracking the function's progress and managing updates effectively.

select
name,
slug,
status,
version
from
supabase_function
where
project_id = 'pljlooizchwsteampipe'
and slug = 'test-function';
select
name,
slug,
status,
version
from
supabase_function
where
project_id = 'pljlooizchwsteampipe'
and slug = 'test-function';

Schema for supabase_function

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
created_attimestamp with time zoneThe time when the function was created.
idtextA unique identifier of the function.
import_mapbooleanIf true, Supabase will automatically generate an import_map file based on the modules used within the function. It indicates whether or not Supabase should use an import_map file to load JavaScript modules within the function.
nametextThe display name of the function.
project_idtext=The ID of the project where the function is located.
slugtext=The function slug.
statustextThe current status of the function.
updated_attimestamp with time zoneThe time when the function was last modified.
verify_jwtbooleanIf true, it allows users to verify the authenticity of JSON Web Tokens (JWTs) issued by Supabase Authentication.
versiontextThe current version of the function.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- supabase

You can pass the configuration to the command with the --config argument:

steampipe_export_supabase --config '<your_config>' supabase_function