Skip to main content

CREATE_PG_SIDECAR_SQL

Constant CREATE_PG_SIDECAR_SQL 

Source
pub const CREATE_PG_SIDECAR_SQL: &str = "\
CREATE TABLE IF NOT EXISTS _pylon_crdt_snapshots (\
    entity     text NOT NULL,\
    row_id     text NOT NULL,\
    snapshot   bytea NOT NULL,\
    updated_at timestamptz NOT NULL DEFAULT now(),\
    PRIMARY KEY (entity, row_id)\
)";
Expand description

SQL to create the PG sidecar table. Idempotent — called every time the runtime opens a Postgres backend so a fresh database gets the table without a manual migration step.