Skip to main content

default_bucket

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

Overview

Namedefault_bucket
TypeResource
Idfirebase.storage.default_bucket

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringResource name of the default bucket.
bucketobjectA storage bucket and its relation to a parent Firebase project. (id: Bucket)
locationstringImmutable. Location of the default bucket.
storageClassstringImmutable. Storage class of the default bucket. Supported values are available at https://cloud.google.com/storage/docs/storage-classes#classes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_default_bucketselectprojectsIdGets the default bucket.
createinsertprojectsIdCreates a Spark tier-eligible Cloud Storage bucket and links it to your Firebase project. If the default bucket already exists, this method will re-link it to your Firebase project. See https://firebase.google.com/pricing for pricing details.
delete_default_bucketdeleteprojectsIdUnlinks and deletes the default bucket.

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
projectsIdstring

SELECT examples

Gets the default bucket.

SELECT
name,
bucket,
location,
storageClass
FROM firebase.storage.default_bucket
WHERE projectsId = '{{ projectsId }}' -- required;

INSERT examples

Creates a Spark tier-eligible Cloud Storage bucket and links it to your Firebase project. If the default bucket already exists, this method will re-link it to your Firebase project. See https://firebase.google.com/pricing for pricing details.

INSERT INTO firebase.storage.default_bucket (
data__name,
data__location,
data__storageClass,
projectsId
)
SELECT
'{{ name }}',
'{{ location }}',
'{{ storageClass }}',
'{{ projectsId }}'
RETURNING
name,
bucket,
location,
storageClass
;

DELETE examples

Unlinks and deletes the default bucket.

DELETE FROM firebase.storage.default_bucket
WHERE projectsId = '{{ projectsId }}' --required;