View Source API Reference electric v0.7.3

Modules

Custom initialisation and reconnection logic for database connections.

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.

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.

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.

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

Responsible for managing shape consumer processes

Dispatches transactions and relations to consumers filtered according to the subscriber's selector function.

Struct describing the requested shape

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

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