Skip to main content

projects

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

Overview

Nameprojects
TypeResource
Iddeno.project.projects

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid) (example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11)
namestring (example: my-project)
createdAtstring (date-time) (example: 2021-08-01T00:00:00Z)
descriptionstring (example: this is my project.)
updatedAtstring (date-time) (example: 2021-08-01T00:00:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_projectsselectorganizationIdpage, limit, q, sort, orderThis API returns a list of projects belonging to the specified organization
in a pagenated manner.
The URLs for the next, previous, first, and last page are returned in the
Link header of the response, if any.
get_projectselectprojectId
create_projectinsertorganizationIdThis API allows you to create a new project under the specified
organization.
The project name is optional; if not provided, a random name will be
generated.
update_projectupdateprojectId
delete_projectdeleteprojectId

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
organizationIdstring (uuid)Organization ID
projectIdstring (uuid)Project ID
limitintegerThe maximum number of items to return per page.
orderstringSort order, either asc or desc. Defaults to asc.
pageintegerThe page number to return.
qstringQuery by project name or project ID
sortstringThe field to sort by, either name, updated_at, requests, or bandwidth. Defaults to updated_at.

SELECT examples

This API returns a list of projects belonging to the specified organization
in a pagenated manner.
The URLs for the next, previous, first, and last page are returned in the
Link header of the response, if any.

SELECT
id,
name,
createdAt,
description,
updatedAt
FROM deno.project.projects
WHERE organizationId = '{{ organizationId }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND q = '{{ q }}'
AND sort = '{{ sort }}'
AND order = '{{ order }}'
;

INSERT examples

This API allows you to create a new project under the specified
organization.
The project name is optional; if not provided, a random name will be
generated.

INSERT INTO deno.project.projects (
data__name,
data__description,
organizationId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ organizationId }}'
RETURNING
id,
name,
createdAt,
description,
updatedAt
;

UPDATE examples

No description available.

UPDATE deno.project.projects
SET
data__name = '{{ name }}',
data__description = '{{ description }}'
WHERE
projectId = '{{ projectId }}' --required
RETURNING
id,
name,
createdAt,
description,
updatedAt;

DELETE examples

No description available.

DELETE FROM deno.project.projects
WHERE projectId = '{{ projectId }}' --required
;