brook_storage_postgres v0.1.2 Brook.Storage.Postgres.Query 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
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 Functions
Link to this function
events_table_create(conn, view_table, events_table)
View Sourceevents_table_create(pid(), schema_table(), schema_table()) :: :ok | {:error, Brook.reason()}
Link to this function
postgres_delete(conn, view_table, collection, key)
View Sourcepostgres_delete( conn(), schema_table(), Brook.view_collection(), Brook.view_key() ) :: :ok | {:error, Brook.reason()}
Link to this function
postgres_get(conn, view_table, collection, key \\ nil)
View Sourcepostgres_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 Sourcepostgres_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 Sourcepostgres_insert_event( conn(), schema_table(), Brook.view_collection(), Brook.view_key(), Brook.event_type(), timestamp(), event() ) :: :ok | {:error, Brook.reason()}
Link to this function
postgres_upsert(conn, view_table, collection, key, value)
View Sourcepostgres_upsert( conn(), schema_table(), Brook.view_collection(), Brook.view_key(), Brook.view_value() ) :: :ok | {:error, Brook.reason()}
Link to this function
schema_create(conn, schema)
View Sourceschema_create(conn(), String.t()) :: :ok | {:error, Brook.reason()}
Link to this function
view_table_create(conn, view_table)
View Sourceview_table_create(conn(), schema_table()) :: :ok | {:error, Brook.reason()}