Skip to main content

buckets

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

Overview​

Namebuckets
TypeResource
Idrailway.storage.buckets

Fields​

The following fields are returned by SELECT queries:

One row per Bucket.

NameDatatypeDescription
idstring
namestring
group_idstring
parent_service_idstring
project_idstring
created_atstring (date-time)
deleted_atstring (date-time)
projectobjectProject object
updated_atstring (date-time)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_idLists Bucket objects of a Project. Backed by the Railway GraphQL query project.buckets.
createinsertproject_idCreate a bucket in a project. Backed by the Railway GraphQL mutation bucketCreate.
updateupdateid, nameUpdates a bucket. Backed by the Railway GraphQL mutation bucketUpdate.

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
project_idstring
idstring
namestringThe name of the bucket.

SELECT examples​

Lists Bucket objects of a Project. Backed by the Railway GraphQL query project.buckets.

SELECT
id,
name,
group_id,
parent_service_id,
project_id,
created_at,
deleted_at,
project,
updated_at
FROM railway.storage.buckets
WHERE project_id = '{{ project_id }}' -- required
;

INSERT examples​

Create a bucket in a project. Backed by the Railway GraphQL mutation bucketCreate.

INSERT INTO railway.storage.buckets (
environment_id,
name,
project_id
)
SELECT
'{{ environment_id }}',
'{{ name }}',
'{{ project_id }}' /* required */
RETURNING
id,
name,
group_id,
parent_service_id,
project_id,
created_at,
deleted_at,
project,
updated_at
;

UPDATE examples​

Updates a bucket. Backed by the Railway GraphQL mutation bucketUpdate.

UPDATE railway.storage.buckets
SET

WHERE
id = '{{ id }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
group_id,
parent_service_id,
project_id,
created_at,
deleted_at,
project,
updated_at;