Skip to main content

edge_functions

Creates, updates, deletes, gets or lists an edge_functions resource.

Overview​

Nameedge_functions
TypeResource
Idsupabase.functions.edge_functions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring
namestring
created_atinteger (int64)
entrypoint_pathstring
ezbr_sha256string
import_mapboolean
import_map_pathstring
slugstring
statusstring (ACTIVE, REMOVED, THROTTLED)
updated_atinteger (int64)
verify_jwtboolean
versioninteger

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfunction_slug, refRetrieves a function with the specified slug and project.
listselectrefReturns all functions you've previously added to the specified project.
createinsertref, slug, name, bodyThis endpoint is deprecated - use the deploy endpoint. Creates a function and adds it to the specified project.
updateupdatefunction_slug, refUpdates a function with the specified slug and project.
deletedeletefunction_slug, refDeletes a function with the specified slug from the specified project.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
function_slugstringFunction slug
refstringSupabase project reference (the Project ID shown in the dashboard under Settings -> General; 20 lowercase letters). Resolved from the SUPABASE_PROJECT_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every project-scoped query as WHERE ref = '<ref>'. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: SUPABASE_PROJECT_ID)

SELECT examples​

Retrieves a function with the specified slug and project.

SELECT
id,
name,
created_at,
entrypoint_path,
ezbr_sha256,
import_map,
import_map_path,
slug,
status,
updated_at,
verify_jwt,
version
FROM supabase.functions.edge_functions
WHERE function_slug = '{{ function_slug }}' -- required
AND ref = '{{ ref }}' -- required unless SUPABASE_PROJECT_ID is set
;

INSERT examples​

This endpoint is deprecated - use the deploy endpoint. Creates a function and adds it to the specified project.

INSERT INTO supabase.functions.edge_functions (
slug,
name,
body,
verify_jwt,
ref
)
SELECT
'{{ slug }}' /* required */,
'{{ name }}' /* required */,
'{{ body }}' /* required */,
{{ verify_jwt }},
'{{ ref }}'
RETURNING
id,
name,
created_at,
entrypoint_path,
ezbr_sha256,
import_map,
import_map_path,
slug,
status,
updated_at,
verify_jwt,
version
;

UPDATE examples​

Updates a function with the specified slug and project.

UPDATE supabase.functions.edge_functions
SET
name = '{{ name }}',
body = '{{ body }}',
verify_jwt = {{ verify_jwt }}
WHERE
function_slug = '{{ function_slug }}' --required
AND ref = '{{ ref }}' --required unless SUPABASE_PROJECT_ID is set
RETURNING
id,
name,
created_at,
entrypoint_path,
ezbr_sha256,
import_map,
import_map_path,
slug,
status,
updated_at,
verify_jwt,
version;

DELETE examples​

Deletes a function with the specified slug from the specified project.

DELETE FROM supabase.functions.edge_functions
WHERE function_slug = '{{ function_slug }}' --required
AND ref = '{{ ref }}' --required unless SUPABASE_PROJECT_ID is set
;