Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idgoogle.discoveryengine.schemas

Fields

NameDatatypeDescription
namestringImmutable. The full resource name of the schema, in the format of projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
jsonSchemastringThe JSON representation of the schema.
structSchemaobjectThe structured representation of the schema.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_collections_data_stores_schemas_getSELECTcollectionsId, dataStoresId, locationsId, projectsId, schemasIdGets a Schema.
projects_locations_collections_data_stores_schemas_listSELECTcollectionsId, dataStoresId, locationsId, projectsIdGets a list of Schemas.
projects_locations_data_stores_schemas_getSELECTdataStoresId, locationsId, projectsId, schemasIdGets a Schema.
projects_locations_data_stores_schemas_listSELECTdataStoresId, locationsId, projectsIdGets a list of Schemas.
projects_locations_collections_data_stores_schemas_createINSERTcollectionsId, dataStoresId, locationsId, projectsIdCreates a Schema.
projects_locations_data_stores_schemas_createINSERTdataStoresId, locationsId, projectsIdCreates a Schema.
projects_locations_collections_data_stores_schemas_deleteDELETEcollectionsId, dataStoresId, locationsId, projectsId, schemasIdDeletes a Schema.
projects_locations_data_stores_schemas_deleteDELETEdataStoresId, locationsId, projectsId, schemasIdDeletes a Schema.
projects_locations_collections_data_stores_schemas_patchUPDATEcollectionsId, dataStoresId, locationsId, projectsId, schemasIdUpdates a Schema.
projects_locations_data_stores_schemas_patchUPDATEdataStoresId, locationsId, projectsId, schemasIdUpdates a Schema.

SELECT examples

Gets a list of Schemas.

SELECT
name,
jsonSchema,
structSchema
FROM google.discoveryengine.schemas
WHERE dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new schemas resource.

/*+ create */
INSERT INTO google.discoveryengine.schemas (
dataStoresId,
locationsId,
projectsId,
structSchema,
jsonSchema,
name
)
SELECT
'{{ dataStoresId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ structSchema }}',
'{{ jsonSchema }}',
'{{ name }}'
;

UPDATE example

Updates a schemas resource.

/*+ update */
UPDATE google.discoveryengine.schemas
SET
structSchema = '{{ structSchema }}',
jsonSchema = '{{ jsonSchema }}',
name = '{{ name }}'
WHERE
dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND schemasId = '{{ schemasId }}';

DELETE example

Deletes the specified schemas resource.

/*+ delete */
DELETE FROM google.discoveryengine.schemas
WHERE dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND schemasId = '{{ schemasId }}';