Electric.Shapes (electric v1.0.17)

View Source

Summary

Functions

Clean up all data (meta data and shape log + snapshot) associated with the given shape handle

Get the last exclusive offset of the chunk starting from the given offset

Get the snapshot followed by the log.

Get or create a shape handle and return it along with the latest offset of the shape

Get the shape that corresponds to this shape definition and return it along with the latest offset of the shape

Check whether the log has an entry for a given shape handle

Types

shape_handle()

@type shape_handle() :: Electric.ShapeCacheBehaviour.shape_handle()

Functions

clean_shape(shape_handle, opts \\ [])

@spec clean_shape(shape_handle(), Access.t()) :: :ok

Clean up all data (meta data and shape log + snapshot) associated with the given shape handle

clean_shapes(shape_handles, opts \\ [])

@spec clean_shapes([shape_handle()], Access.t()) :: :ok

get_chunk_end_log_offset(config, shape_handle, offset)

@spec get_chunk_end_log_offset(
  Access.t(),
  shape_handle(),
  Electric.Replication.LogOffset.t()
) ::
  Electric.Replication.LogOffset.t() | nil

Get the last exclusive offset of the chunk starting from the given offset

If nil is returned, chunk is not complete and the shape's latest offset should be used

get_merged_log_stream(config, shape_handle, opts)

Get the snapshot followed by the log.

get_or_create_shape_handle(config, shape_def)

@spec get_or_create_shape_handle(Access.t(), Electric.Shapes.Shape.t()) ::
  {shape_handle(), Electric.Replication.LogOffset.t()}

Get or create a shape handle and return it along with the latest offset of the shape

get_shape(config, shape_def)

Get the shape that corresponds to this shape definition and return it along with the latest offset of the shape

has_shape?(config, shape_handle)

@spec has_shape?(Access.t(), shape_handle()) :: boolean()

Check whether the log has an entry for a given shape handle