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
| 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. |
| Name | Datatype | Description |
|---|
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 | orderBy, pageSize, filter, pageToken | Lists Schemas in a given project and location. |
create | insert | projectsId, locationsId, servicesId | requestId, schemaId, 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 | validateOnly, requestId, updateMask, allowMissing | Updates the parameters of a single Schema, and creates a new SchemaRevision with the updated Schema. |
delete | delete | projectsId, locationsId, servicesId, schemasId | requestId, etag, validateOnly, force, allowMissing | 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.
SELECT
*
FROM firebase.dataconnect.schemas
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND servicesId = '{{ servicesId }}' -- required
AND orderBy = '{{ orderBy }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
AND pageToken = '{{ pageToken }}'
;
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__labels,
data__name,
data__displayName,
data__annotations,
data__datasources,
data__source,
projectsId,
locationsId,
servicesId,
requestId,
schemaId,
validateOnly
)
SELECT
'{{ labels }}',
'{{ name }}',
'{{ displayName }}',
'{{ annotations }}',
'{{ datasources }}',
'{{ source }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ servicesId }}',
'{{ requestId }}',
'{{ schemaId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: schemas
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the schemas resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the schemas resource.
- name: servicesId
value: "{{ servicesId }}"
description: Required parameter for the schemas resource.
- name: labels
value: "{{ labels }}"
description: |
Optional. Labels as key value pairs.
- name: name
value: "{{ name }}"
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: displayName
value: "{{ displayName }}"
description: |
Optional. Mutable human-readable name. 63 character limit.
- name: annotations
value: "{{ annotations }}"
description: |
Optional. Stores small amounts of arbitrary data.
- name: datasources
description: |
Required. The data sources linked in the schema.
value:
- postgresql:
schemaValidation: "{{ schemaValidation }}"
ephemeral: {{ ephemeral }}
database: "{{ database }}"
schemaMigration: "{{ schemaMigration }}"
unlinked: {{ unlinked }}
cloudSql:
edition: "{{ edition }}"
instance: "{{ instance }}"
schema: "{{ schema }}"
httpGraphql:
uri: "{{ uri }}"
timeout: "{{ timeout }}"
- name: source
description: |
Required. The source files that comprise the application schema.
value:
files:
- path: "{{ path }}"
content: "{{ content }}"
- name: requestId
value: "{{ requestId }}"
- name: schemaId
value: "{{ schemaId }}"
- name: validateOnly
value: {{ validateOnly }}
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__labels = '{{ labels }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__annotations = '{{ annotations }}',
data__datasources = '{{ datasources }}',
data__source = '{{ source }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND servicesId = '{{ servicesId }}' --required
AND schemasId = '{{ schemasId }}' --required
AND validateOnly = {{ validateOnly}}
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
AND allowMissing = {{ allowMissing}}
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 requestId = '{{ requestId }}'
AND etag = '{{ etag }}'
AND validateOnly = '{{ validateOnly }}'
AND force = '{{ force }}'
AND allowMissing = '{{ allowMissing }}'
;