schemas
Creates, updates, deletes, gets or lists a schemas
resource.
Overview
Name | schemas |
Type | Resource |
Id | firebase.dataconnect.schemas |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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". |
annotations | object | Optional. Stores small amounts of arbitrary data. |
createTime | string (google-datetime) | Output only. [Output only] Create time stamp. |
datasources | array | Required. The data sources linked in the schema. |
displayName | string | Optional. Mutable human-readable name. 63 character limit. |
etag | string | Output 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 |
labels | object | Optional. Labels as key value pairs. |
reconciling | boolean | Output only. A field that if true, indicates that the system is working to compile and deploy the schema. |
source | object | Required. The source files that comprise the application schema. (id: Source) |
uid | string | Output only. System-assigned, unique identifier. |
updateTime | string (google-datetime) | Output only. [Output only] Update time stamp. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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". |
annotations | object | Optional. Stores small amounts of arbitrary data. |
createTime | string (google-datetime) | Output only. [Output only] Create time stamp. |
datasources | array | Required. The data sources linked in the schema. |
displayName | string | Optional. Mutable human-readable name. 63 character limit. |
etag | string | Output 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 |
labels | object | Optional. Labels as key value pairs. |
reconciling | boolean | Output only. A field that if true, indicates that the system is working to compile and deploy the schema. |
source | object | Required. The source files that comprise the application schema. (id: Source) |
uid | string | Output only. System-assigned, unique identifier. |
updateTime | string (google-datetime) | Output only. [Output only] Update time stamp. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , servicesId , schemasId | Gets details of a single Schema. | |
list | select | projectsId , locationsId , servicesId | pageSize , pageToken , filter , orderBy | Lists Schemas in a given project and location. Note that only schemas/main is supported, so this will always return at most one Schema. |
create | insert | projectsId , locationsId , servicesId | schemaId , requestId , validateOnly | 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. |
patch | update | projectsId , locationsId , servicesId , schemasId | updateMask , requestId , allowMissing , validateOnly | Updates the parameters of a single Schema, and creates a new SchemaRevision with the updated Schema. |
delete | delete | projectsId , locationsId , servicesId , schemasId | force , etag , requestId , allowMissing , validateOnly | 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. |
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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
schemasId | string | |
servicesId | string | |
allowMissing | boolean | |
etag | string | |
filter | string | |
force | boolean | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
schemaId | string | |
updateMask | string (google-fieldmask) | |
validateOnly | boolean |
SELECT
examples
- get
- list
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;
Lists Schemas in a given project and location. Note that only schemas/main
is supported, so this will always return at most one 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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: schemas
props:
- name: projectsId
value: string
description: Required parameter for the schemas resource.
- name: locationsId
value: string
description: Required parameter for the schemas resource.
- name: servicesId
value: string
description: Required parameter for the schemas resource.
- name: name
value: string
description: >
Identifier. 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".
- name: labels
value: object
description: >
Optional. Labels as key value pairs.
- name: annotations
value: object
description: >
Optional. Stores small amounts of arbitrary data.
- name: datasources
value: array
description: >
Required. The data sources linked in the schema.
- name: source
value: object
description: >
Required. The source files that comprise the application schema.
- name: displayName
value: string
description: >
Optional. Mutable human-readable name. 63 character limit.
- name: schemaId
value: string
- name: requestId
value: string
- name: validateOnly
value: boolean
UPDATE
examples
- patch
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
- delete
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 }}';