edge_functions
Creates, updates, deletes, gets or lists an edge_functions resource.
Overview​
| Name | edge_functions |
| Type | Resource |
| Id | supabase.functions.edge_functions |
Fields​
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
created_at | integer (int64) | |
entrypoint_path | string | |
ezbr_sha256 | string | |
import_map | boolean | |
import_map_path | string | |
slug | string | |
status | string | (ACTIVE, REMOVED, THROTTLED) |
updated_at | integer (int64) | |
verify_jwt | boolean | |
version | integer |
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
created_at | integer (int64) | |
entrypoint_path | string | |
ezbr_sha256 | string | |
import_map | boolean | |
import_map_path | string | |
slug | string | |
status | string | (ACTIVE, REMOVED, THROTTLED) |
updated_at | integer (int64) | |
verify_jwt | boolean | |
version | integer |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | function_slug, ref | Retrieves a function with the specified slug and project. | |
list | select | ref | Returns all functions you've previously added to the specified project. | |
create | insert | ref, slug, name, body | This endpoint is deprecated - use the deploy endpoint. Creates a function and adds it to the specified project. | |
update | update | function_slug, ref | Updates a function with the specified slug and project. | |
delete | delete | function_slug, ref | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
function_slug | string | Function slug |
ref | string | Supabase 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​
- get
- list
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
;
Returns all functions you've previously added to the specified 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 ref = '{{ ref }}' -- required unless SUPABASE_PROJECT_ID is set
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: edge_functions
props:
- name: ref
value: "{{ ref }}"
description: Required parameter for the edge_functions resource.
- name: slug
value: "{{ slug }}"
- name: name
value: "{{ name }}"
- name: body
value: "{{ body }}"
- name: verify_jwt
value: {{ verify_jwt }}
UPDATE examples​
- update
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​
- delete
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
;