Brook.Storage.Postgres.Query (brook_storage_postgres v0.1.3) View Source
Abstracts the Postgrex SQL query functions away from the storage behaviour implementation.
Collects the command run directly against the Postgrex API in a single location for creates, inserts, selects, and deletes.
Link to this section Summary
Types
The pid of the Postgrex connection process
The serialized and compressed version of a Brook event
The combination of the view application view schema and table in 'schema_name.table_name' format
The timestamp of an event's creation
Link to this section Types
Specs
conn() :: pid()
The pid of the Postgrex connection process
Specs
event() :: binary()
The serialized and compressed version of a Brook event
Specs
schema_table() :: String.t()
The combination of the view application view schema and table in 'schema_name.table_name' format
Specs
timestamp() :: non_neg_integer()
The timestamp of an event's creation
Link to this section Functions
Specs
events_table_create(pid(), schema_table(), schema_table()) :: :ok | {:error, Brook.reason()}
Specs
postgres_delete( conn(), schema_table(), Brook.view_collection(), Brook.view_key() ) :: :ok | {:error, Brook.reason()}
Specs
postgres_get( conn(), schema_table(), Brook.view_collection(), Brook.view_key() | nil ) :: {:ok, [Brook.view_value()]} | {:error, Brook.reason()}
Link to this function
postgres_get_events(conn, events_table, collection, key, type \\ nil)
View SourceSpecs
postgres_get_events( conn(), schema_table(), Brook.view_collection(), Brook.view_key(), Brook.event_type() | nil ) :: {:ok, [event()]} | {:error, Brook.reason()}
Link to this function
postgres_insert_event(conn, events_table, collection, key, type, timestamp, event)
View SourceSpecs
postgres_insert_event( conn(), schema_table(), Brook.view_collection(), Brook.view_key(), Brook.event_type(), timestamp(), event() ) :: :ok | {:error, Brook.reason()}
Specs
postgres_upsert( conn(), schema_table(), Brook.view_collection(), Brook.view_key(), Brook.view_value() ) :: :ok | {:error, Brook.reason()}
Specs
schema_create(conn(), String.t()) :: :ok | {:error, Brook.reason()}
Specs
view_table_create(conn(), schema_table()) :: :ok | {:error, Brook.reason()}