Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idfirebase.dataconnect.schemas

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The relative resource name of the schema, in the format: projects/{project}/locations/{location}/services/{service}/schemas/{schema} Right now, the only supported schema is "main".
annotationsobjectOptional. Stores small amounts of arbitrary data.
createTimestring (google-datetime)Output only. [Output only] Create time stamp.
datasourcesarrayRequired. The data sources linked in the schema.
displayNamestringOptional. Mutable human-readable name. 63 character limit.
etagstringOutput only. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. AIP-154
labelsobjectOptional. Labels as key value pairs.
reconcilingbooleanOutput only. A field that if true, indicates that the system is working to compile and deploy the schema.
sourceobjectRequired. The source files that comprise the application schema. (id: Source)
uidstringOutput only. System-assigned, unique identifier.
updateTimestring (google-datetime)Output only. [Output only] Update time stamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, servicesId, schemasIdGets details of a single Schema.
listselectprojectsId, locationsId, servicesIdpageSize, pageToken, filter, orderByLists Schemas in a given project and location. Note that only schemas/main is supported, so this will always return at most one Schema.
createinsertprojectsId, locationsId, servicesIdschemaId, requestId, validateOnlyCreates a new Schema in a given project and location. Only creation of schemas/main is supported and calling create with any other schema ID will result in an error.
patchupdateprojectsId, locationsId, servicesId, schemasIdupdateMask, requestId, allowMissing, validateOnlyUpdates the parameters of a single Schema, and creates a new SchemaRevision with the updated Schema.
deletedeleteprojectsId, locationsId, servicesId, schemasIdforce, etag, requestId, allowMissing, validateOnlyDeletes a single Schema. Because the schema and connectors must be compatible at all times, if this is called while any connectors are active, this will result in an error.

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
locationsIdstring
projectsIdstring
schemasIdstring
servicesIdstring
allowMissingboolean
etagstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
schemaIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Gets details of a single Schema.

SELECT
name,
annotations,
createTime,
datasources,
displayName,
etag,
labels,
reconciling,
source,
uid,
updateTime
FROM firebase.dataconnect.schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND servicesId = '{{ servicesId }}' -- required
AND schemasId = '{{ schemasId }}' -- required;

INSERT examples

Creates a new Schema in a given project and location. Only creation of schemas/main is supported and calling create with any other schema ID will result in an error.

INSERT INTO firebase.dataconnect.schemas (
data__name,
data__labels,
data__annotations,
data__datasources,
data__source,
data__displayName,
projectsId,
locationsId,
servicesId,
schemaId,
requestId,
validateOnly
)
SELECT
'{{ name }}',
'{{ labels }}',
'{{ annotations }}',
'{{ datasources }}',
'{{ source }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ servicesId }}',
'{{ schemaId }}',
'{{ requestId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single Schema, and creates a new SchemaRevision with the updated Schema.

UPDATE firebase.dataconnect.schemas
SET
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__annotations = '{{ annotations }}',
data__datasources = '{{ datasources }}',
data__source = '{{ source }}',
data__displayName = '{{ displayName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND servicesId = '{{ servicesId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND allowMissing = {{ allowMissing}}
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single Schema. Because the schema and connectors must be compatible at all times, if this is called while any connectors are active, this will result in an error.

DELETE FROM firebase.dataconnect.schemas
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND servicesId = '{{ servicesId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND force = '{{ force }}'
AND etag = '{{ etag }}'
AND requestId = '{{ requestId }}'
AND allowMissing = '{{ allowMissing }}'
AND validateOnly = '{{ validateOnly }}';