View Source API Reference electric v0.9.5

Modules

Custom initialisation and reconnection logic for database connections.

The connection supervisor is a rest-for-one supervisor that starts Connection.Manager, followed by Replication.Supervisor.

Defines the structure and how to create the items in the log that the electric client reads.

An implementation of PersistentKV that writes values serialised as JSON to the kv backend.

A plug that assists debugging by labelling processes that handle requests with details about the request.

A plug that extracts trace context from incoming HTTP headers and sets it as the parent span.

Utility functions for Electric endpoints, e.g. for parsing and validating path and query parameters.

Module for functions that configure Postgres in some way using a provided connection.

Utility module for splitting strings on a schema delimiter

A Postgres connection that ensures an advisory lock is held for its entire duration, useful for ensuring only a single sync service instance can be using a single replication slot at any given time.

Encoding, decoding and helper functions for the pg_lsn type.

A client module for Postgres logical replication.

Conversion of incoming Postgres logical replication messages to internal change representation.

This module encapsulates the initial setup of a replication connection opened by Electric.Postgres.ReplicationClient.

This module contains structs that are intermediate representation of Postgres and Satellite transactions.

Evaluation environment for parsing PostgreSQL expressions.

This module describes basic types, their categories, and if they are preferred within said category. Information here is gathered from a system catalog pg_type, as described in PG docs.

Postgres has explicit casts, achievable via ::type calls. This module defines implementations for a subset of known ones. "function name" column here is a function name in this module.

List of all implicit casts in (raw) PostgreSQL. Does not account for custom casts, which are discouraged anyway. If needed, this list can be extended in Electric.Replication.Eval.Env.new/1

Parsed expression, available for evaluation using the runner

Special module to be use-d to define translation of PostgreSQL operators and functions into Elixir calls.

Uniquely identifies an operation inside the shape log. Combines a transaction ID with operation ID.

When any txn comes from postgres, we need to store it into the log for this shape if and only if it has txid >= xmin of the snapshot.

A thing wrapper module around FileStorage that can be configured to raise an error after a certain number of writes.

Keeps track of shape state.

Behaviour defining the ShapeStatus functions to be used in mocks

Behaviour defining the ShapeCache functions to be used in mocks

Dispatches transactions and relations to consumers filtered using Filter and the consumer's shape.

Responsible for managing shape consumer processes

Responsible for knowing which shapes are affected by a change.

Responsible for knowing which shapes are affected by a change to a specific field.

Responsible for knowing which shapes are affected by a change to a specific table.

Struct describing the requested shape

Root supervisor that starts a stack of processes to serve shapes.

Reporter that collects runtime telemetry information and sends it to a configured home server once in a while. The information is aggregated over a period of time, with percentile values calculated for the metrics that have them.

This module implements an API to cover parts of the code with tracing spans that are then exported using the OpenTelemetry protocol.

Custom sampler that samples all spans except for specifically configured spans for which a given ratio is sampled.

A custom Sentry HTTP client implementation using Req.

Module exporting functions for handling Postgres timelines. Verifies the Postgres ID and its timeline.

PostgreSQL interval representation.

This module parses alternative ISO-8601 duration strings into Interval structs.

This module parses ISO-8601 duration strings into Interval structs.

This module parses Postgres classic and SQL strings