View Source Electric.Postgres.Configuration (electric v1.0.1)
Module for functions that configure Postgres in some way using a provided connection.
Summary
Types
@type filters() :: %{ required(Electric.relation()) => Electric.Replication.PublicationManager.RelationFilter.t() }
Functions
Link to this function
configure_tables_for_replication!(pool, relation_filters, pg_version, publication_name)
View Source@spec configure_tables_for_replication!( Postgrex.conn(), filters(), String.t(), float() ) :: {:ok, [:ok]}
Ensure that all tables are configured for replication.
Table is considered configured for replication when it's REPLICA IDENTITY
is set to FULL
and it's added to the specified publication.
Important: this function should not be ran in a transaction, because it starts multiple internal transactions that are sometimes expected to fail.
Raises if it fails to configure all the tables in the expected way.
@spec get_pg_version(Postgrex.conn()) :: {:ok, non_neg_integer()} | {:error, term()}
Get Postgres server version
@spec get_publication_tables(Postgrex.conn(), String.t()) :: [Electric.relation()]