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, versionfrom supabase_function;
select name, slug, status, versionfrom 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, versionfrom supabase_functionwhere status = 'THROTTLED';
select name, slug, status, versionfrom supabase_functionwhere 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, versionfrom supabase_functionwhere verify_jwt;
select name, slug, status, versionfrom supabase_functionwhere 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_idfrom supabase_functionwhere updated_at < (current_date - interval '30 days');
select name, slug, status, version, project_idfrom supabase_functionwhere 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, versionfrom supabase_functionwhere project_id = 'pljlooizchwsteampipe' and slug = 'test-function';
select name, slug, status, versionfrom supabase_functionwhere project_id = 'pljlooizchwsteampipe' and slug = 'test-function';
Schema for supabase_function
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
created_at | timestamp with time zone | The time when the function was created. | |
id | text | A unique identifier of the function. | |
import_map | boolean | If 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. | |
name | text | The display name of the function. | |
project_id | text | = | The ID of the project where the function is located. |
slug | text | = | The function slug. |
status | text | The current status of the function. | |
updated_at | timestamp with time zone | The time when the function was last modified. | |
verify_jwt | boolean | If true, it allows users to verify the authenticity of JSON Web Tokens (JWTs) issued by Supabase Authentication. | |
version | text | The 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