Electric.ShapeCache.ShapeStatus.ShapeDb (electric v1.4.13)
View SourceSQLite-backed persistent storage for shape metadata.
The WriteBuffer provides buffering for writes to prevent timeout cascades.
Only handle_for_shape and shape_for_handle need buffer awareness since
they are entry points for new requests. Other functions are called after
ShapeStatus has already updated its ETS cache.
Summary
Functions
Find a handle for a shape. Checks buffer first, then SQLite. Returns :error if the handle is tombstoned (being deleted).
Find a handle for a shape using the write connection to guarantee consistency.
Returns the number of pending writes in the buffer
Find a shape by its handle. Checks buffer first, then SQLite. Returns :error if the handle is tombstoned (being deleted).
Types
@type shape_handle() :: Electric.shape_handle()
@type stack_id() :: Electric.stack_id()
Functions
Find a handle for a shape. Checks buffer first, then SQLite. Returns :error if the handle is tombstoned (being deleted).
Find a handle for a shape using the write connection to guarantee consistency.
@spec pending_buffer_size(stack_id()) :: non_neg_integer()
Returns the number of pending writes in the buffer
Find a shape by its handle. Checks buffer first, then SQLite. Returns :error if the handle is tombstoned (being deleted).