Public Schemas

Public schemas define how data is exposed from a data store managed by ReJot, see our Defining Schemas guide for more details.

Public Schema

name: string required

Unique name for the public schema.

source: Source required
outputSchema: JsonSchema required
version: Version required
definitionFile: string

Path to the source file defining this schema.

config: Config required

Configuration details specific to the public schema type.

Source

dataStoreSlug: string required

Slug of the data store that contains the source data.

Version

major: number required
minor: number required

Config

The configuration of a public schema depends on its type, specified by the publicSchemaType field. Currently, the following types are supported:

Postgres

Configuration for PostgreSQL-based public schemas.

publicSchemaType: string [const] required
= "postgres"
transformations: Transformation[] required

Transformations

Transformations define how changes in source tables are reflected in the public schema.

operation: string [enum] required
= "insert" | "update" | "delete"

This transformation will be used when this operation is executed on the source table.

table: string required

This transformation will be applied when this source table is changed.

sql: string required

The SQL query to execute when a relevant operation is performed on the source table. This query supports positional query parameters ($1, $2), or named parameters (:name), but not both at the same time. Note that positional parameters will be ordered according to the column order in the table definition.