REST Resource: projects.locations.services.schemas

Resource: Schema

The application schema of a Firebase SQL Connect service.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "datasources": [
    {
      object (Datasource)
    }
  ],
  "source": {
    object (Source)
  },
  "uid": string,
  "reconciling": boolean,
  "displayName": string,
  "etag": string
}
Fields
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".

createTime

string (Timestamp format)

Output only. [Output only] Create time stamp.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

Output only. [Output only] Update time stamp.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

labels

map (key: string, value: string)

Optional. Labels as key value pairs.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Optional. Stores small amounts of arbitrary data.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

datasources[]

object (Datasource)

Required. The data sources linked in the schema.

source

object (Source)

Required. The source files that comprise the application schema.

uid

string

Output only. System-assigned, unique identifier.

reconciling

boolean

Output only. A field that if true, indicates that the system is working to compile and deploy 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

Datasource

A data source that backs Firebase SQL Connect services.

JSON representation
{

  // Union field configuration can be only one of the following:
  "postgresql": {
    object (PostgreSql)
  },
  "httpGraphql": {
    object (HttpGraphql)
  }
  // End of list of possible types for union field configuration.
}
Fields
Union field configuration. Settings and configurations of the underlying data source. configuration can be only one of the following:
postgresql

object (PostgreSql)

PostgreSQL configurations.

httpGraphql

object (HttpGraphql)

HTTP GraphQL server webhook configurations.

PostgreSql

Settings for PostgreSQL data source.

JSON representation
{
  "database": string,
  "ephemeral": boolean,
  "schema": string,

  // Union field before_deploy can be only one of the following:
  "schemaValidation": enum (SqlSchemaValidation),
  "schemaMigration": enum (SqlSchemaMigration)
  // End of list of possible types for union field before_deploy.

  // Union field configuration can be only one of the following:
  "unlinked": boolean,
  "cloudSql": {
    object (CloudSqlInstance)
  }
  // End of list of possible types for union field configuration.
}
Fields
database

string

Required. Name of the PostgreSQL database.

ephemeral

boolean

Output only. Ephemeral is true if this SQL Connect service is served from temporary in-memory emulation of Postgres.

While Cloud SQL is being provisioned, the SQL Connect service provides the ephemeral service to help developers get started. Once the Cloud SQL is provisioned, SQL Connect service will transfer its data on a best-effort basis to the Cloud SQL instance.

WARNING: Ephemeral data sources will expire after 24 hour. The data will be lost if they aren't transferred to the Cloud SQL instance.

WARNING: When ephemeral=true, mutations to the database are not guaranteed to be durably persisted, even if an OK status code is returned. All or parts of the data may be lost or reverted to earlier versions.

schema

string

Optional. User-configured PostgreSQL schema. Defaults to "public" if not specified.

Union field before_deploy. Configure the behavior before deploying this schema. Default to schema_validation=STRICT if not specified. before_deploy can be only one of the following:
schemaValidation

enum (SqlSchemaValidation)

Optional. Configure how much Postgresql schema validation to perform.

schemaMigration

enum (SqlSchemaMigration)

Optional. Configure how to perform Postgresql schema migration.

Union field configuration. Settings and configurations of the underlying database. configuration can be only one of the following:
unlinked
(deprecated)

boolean

No Postgres data source is linked. If set, don't allow database and schemaValidation to be configured.

cloudSql

object (CloudSqlInstance)

Cloud SQL configurations.

SqlSchemaValidation

Configure how much SQL Schema to perform for the given schema.

Enums
SQL_SCHEMA_VALIDATION_UNSPECIFIED Unspecified SQL schema validation. Default to STRICT.
NONE Skip no SQL schema validation. Use it with extreme caution. schemas.create or schemas.patch will succeed even if SQL database is unavailable or SQL schema is incompatible. Generated SQL may fail at execution time.
STRICT Connect to the SQL database and validate that the SQL DDL matches the schema exactly. Surface any discrepancies as FAILED_PRECONDITION with an IncompatibleSqlSchemaError error detail.
COMPATIBLE Connect to the SQL database and validate that the SQL DDL has all the SQL resources used in the given Firebase SQL Connect Schema. Surface any missing resources as FAILED_PRECONDITION with an IncompatibleSqlSchemaError error detail. Succeed even if there are unknown tables and columns.

SqlSchemaMigration

Configure how to perform SQL Schema migration before deploying the Schema.

Enums
SQL_SCHEMA_MIGRATION_UNSPECIFIED Unspecified SQL schema migration.
MIGRATE_COMPATIBLE Connect to the SQL database and identify any missing SQL resources used in the given Firebase SQL Connect Schema. Automatically create necessary SQL resources (SQL table, column, etc) before deploying the schema. During migration steps, the SQL Schema must comply with the previous before_deploy setting in case the migration is interrupted. Therefore, the previous before_deploy setting must not be schemaValidation=STRICT.

CloudSqlInstance

Settings for CloudSQL instance configuration.

JSON representation
{
  "instance": string
}
Fields
instance

string

Required. Name of the CloudSQL instance, in the format:

projects/{project}/locations/{location}/instances/{instance}

HttpGraphql

Settings for HTTP GraphQL server webhook.

JSON representation
{
  "uri": string,
  "timeout": string
}
Fields
uri

string

Required. The endpoint of the HTTP GraphQL server.

timeout

string (Duration format)

Optional. Timeout duration for the HTTP request.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Methods

create

Creates a new Schema in a given project and location.

delete

Deletes a single Schema.

get

Gets details of a single Schema.

list

Lists Schemas in a given project and location.

patch

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