Skip to main content

snippets

Creates, updates, deletes, gets or lists a snippets resource.

Overview​

Namesnippets
TypeResource
Idsupabase.database.snippets

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring
namestring
contentobject
descriptionstring
favoriteboolean
inserted_atstring
ownerobject
projectobject
typestring (sql)
updated_atstring
updated_byobject
visibilitystring (user, project, org, public)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, ref
listselectrefproject_ref, cursor, limit, sort_by, sort_order

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
idstring (uuid)
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)
cursorstring
limitstring
project_refstringProject ref
sort_bystring
sort_orderstring

SELECT examples​

No description available.

SELECT
id,
name,
content,
description,
favorite,
inserted_at,
owner,
project,
type,
updated_at,
updated_by,
visibility
FROM supabase.database.snippets
WHERE id = '{{ id }}' -- required
AND ref = '{{ ref }}' -- required unless SUPABASE_PROJECT_ID is set
;