Liking cljdoc? Tell your friends :D

ottla.postgresql


append-lock-classidclj

First key of the two-key advisory lock taken by appends. Namespaces ottla's locks away from application advisory locks; the second key is the topic table's oid.

First key of the two-key advisory lock taken by appends. Namespaces
ottla's locks away from application advisory locks; the second key is
the topic table's oid.
sourceraw docstring

brin-index-templateclj

source

btree-key-index-templateclj

source

column-typesclj

source

commit-modesclj

source

commit-offset!clj

(commit-offset! {:keys [conn schema]} {:keys [topic group]} cursor)
source

connect-configclj

(connect-config config)
source

consumer-lock-classidclj

First key of the two-key session advisory lock a consumer holds while it's its group's active consumer. The second key is the subscription's sid.

First key of the two-key session advisory lock a consumer holds while
it's its group's active consumer. The second key is the subscription's
`sid`.
sourceraw docstring

create-subscriptionclj

(create-subscription {:keys [conn schema] :as config}
                     {:keys [topic group]}
                     &
                     {:keys [from]})

Create a subscription for topic/group. Throws ex-info with {:topic ... :group ...} if a subscription already exists.

Create a subscription for topic/group. Throws ex-info with
{:topic ... :group ...} if a subscription already exists.
sourceraw docstring

create-topicclj

(create-topic {:keys [conn schema]}
              topic
              &
              {:keys [key-type value-type index-key?]
               :as opts
               :or {key-type :bytea value-type :bytea index-key? false}})
source

default-subscription-groupclj

source

delete-subscriptionclj

(delete-subscription {:keys [conn schema]} {:keys [topic group]})

Delete a subscription for topic/group. Returns true if a subscription was deleted, false if none existed.

Delete a subscription for topic/group. Returns true if a subscription was
deleted, false if none existed.
sourceraw docstring

delete-topicclj

(delete-topic {:keys [conn schema]} topic)
source

deserializer-xfclj

(deserializer-xf config topic {:keys [deserialize-key deserialize-value]})
source

ensure-schemaclj

(ensure-schema {:keys [conn schema]})
source

ensure-subscriptionclj

(ensure-subscription {:keys [conn schema] :as config}
                     {:keys [topic group]}
                     &
                     {:keys [from]})

Create a subscription for topic/group if one does not already exist. Returns true if created, false if it already existed. The :from option only applies when creating; an existing subscription is not modified.

Create a subscription for topic/group if one does not already exist.
Returns true if created, false if it already existed. The :from option
only applies when creating; an existing subscription is not modified.
sourceraw docstring

ensure-topicclj

(ensure-topic {:keys [conn] :as config}
              topic-name
              &
              {:keys [key-type value-type]
               :as opts
               :or {key-type :bytea value-type :bytea}})

Fetch or create a topic. Returns the existing topic if it already exists with the same key-type and value-type. Throws if the topic exists but was created with different column types. Note: opts apply only at creation time and cannot be used to change an existing topic.

Fetch or create a topic. Returns the existing topic if it already exists
with the same key-type and value-type. Throws if the topic exists but was
created with different column types. Note: opts apply only at creation time
and cannot be used to change an existing topic.
sourceraw docstring

fetch-cursorclj

(fetch-cursor {:keys [conn schema]} {:keys [topic group]})

The cursor of the subscription for topic/group, or nil if there is none.

The cursor of the subscription for topic/group, or nil if there is none.
sourceraw docstring

fetch-records!clj

(fetch-records! config selection)
source

fetch-records*clj

(fetch-records* {:keys [conn schema] :as config}
                {:keys [topic group commit-mode] :as selection})
source

fetch-topicclj

(fetch-topic config topic-name)
source

insert-recordsclj

(insert-records {:keys [conn conn-map schema] :as cfg}
                topic
                records
                &
                {:keys [serialize-key serialize-value] :as opts})

Insert records into a topic. topic is a topic name, or a topic map with :topic, :key-type, and :value-type; passing a map skips the topic lookup.

Insert records into a topic. `topic` is a topic name, or a topic map
with `:topic`, `:key-type`, and `:value-type`; passing a map skips the
topic lookup.
sourceraw docstring

(legal-identifier? s)
source

list-subscriptionsclj

(list-subscriptions {:keys [conn schema]} & [{:keys [selections]}])
source

list-topicsclj

(list-topics {:keys [conn schema]})
source

maybe-fetch-topicclj

(maybe-fetch-topic {:keys [conn schema]} topic-name)
source

normalize-identifier-nameclj

(normalize-identifier-name topic)
source

normalize-selectionclj

(normalize-selection selection)
source

notify-channelclj

The channel every topic's trigger NOTIFYs on, with the payload <topic>:<eid> (see parse-notification).

The channel every topic's trigger NOTIFYs on, with the payload
`<topic>:<eid>` (see `parse-notification`).
sourceraw docstring

parse-notificationclj

(parse-notification payload)

Parse a notification payload of the form <topic>:<eid> into [topic eid]. The topic is everything before the last colon; eid is nil if what follows isn't a long. Returns nil if there is no colon.

Parse a notification payload of the form `<topic>:<eid>` into
`[topic eid]`. The topic is everything before the last colon; eid is
nil if what follows isn't a long. Returns nil if there is no colon.
sourceraw docstring

reset-offset!clj

(reset-offset! {:keys [conn schema]} {:keys [topic group]} cursor)
source

selection-defaultsclj

source

serialize-function-nameclj

(serialize-function-name schema)
source

serialize-function-templateclj

source

serialize-trigger-templateclj

source

sql-entityclj

(sql-entity x)
source

subs-fillfactorclj

Fillfactor for the subs table. Each fetch updates its group's row (cursor, updated_at), and neither column is indexed, so with room left on the page those updates can be HOT updates, which skip index maintenance and are pruned without waiting for vacuum. The table has one small row per group, so leaving half of each page free is cheap.

Fillfactor for the subs table. Each fetch updates its group's row
(cursor, updated_at), and neither column is indexed, so with room left
on the page those updates can be HOT updates, which skip index
maintenance and are pruned without waiting for vacuum. The table has
one small row per group, so leaving half of each page free is cheap.
sourceraw docstring

topic-subscriptionsclj

(topic-subscriptions {:keys [conn] :as config} & [{:keys [selections]}])

Returns all topics with their consumer group subscriptions nested under each topic. Unlike list-subscriptions, every topic appears in the result even if it has no subscribers.

Each entry is a map with:

  • :topic the topic name
  • :subscriptions a vector of subscription maps (empty when no subscribers)

Each subscription map contains the same keys as list-subscriptions (except :topic, which is on the outer map):

  • :group consumer group id
  • :offset last committed eid for this group
  • :topic-eid highest eid available in the topic
  • :lag topic-eid - offset: an upper bound on unread records, since eids can have gaps
  • :updated-at java.time.Instant of the last offset commit (nil if never committed)
  • :timestamp java.time.Instant of the last consumed record (nil if offset is 0)
  • :topic-timestamp java.time.Instant of the latest record in the topic (nil if empty)
  • :timestamp-lag java.time.Duration between subscription and topic timestamps (nil if either is nil)
  • :processing-delay java.time.Duration from publish time to consumer commit for the most recently consumed record (nil if either :updated-at or :timestamp is nil)
Returns all topics with their consumer group subscriptions nested under each
topic. Unlike `list-subscriptions`, every topic appears in the result even if
it has no subscribers.

Each entry is a map with:
  - :topic          the topic name
  - :subscriptions  a vector of subscription maps (empty when no subscribers)

Each subscription map contains the same keys as `list-subscriptions` (except
:topic, which is on the outer map):
  - :group             consumer group id
  - :offset            last committed eid for this group
  - :topic-eid         highest eid available in the topic
  - :lag               topic-eid - offset: an upper bound on unread records, since eids can have gaps
  - :updated-at        java.time.Instant of the last offset commit (nil if never committed)
  - :timestamp         java.time.Instant of the last consumed record (nil if offset is 0)
  - :topic-timestamp   java.time.Instant of the latest record in the topic (nil if empty)
  - :timestamp-lag     java.time.Duration between subscription and topic timestamps (nil if either is nil)
  - :processing-delay  java.time.Duration from publish time to consumer commit for the most
                       recently consumed record (nil if either :updated-at or :timestamp is nil)
sourceraw docstring

topic-table-nameclj

(topic-table-name topic)
source

trigger-function-nameclj

(trigger-function-name schema)
source

trigger-function-templateclj

source

trigger-templateclj

source

trim-topicclj

(trim-topic {:keys [conn schema] :as config}
            topic
            &
            {:keys [before-eid before-timestamp all? ignore-subscriptions?]
             :or {ignore-subscriptions? false}})
source

try-lock-subscriptionclj

(try-lock-subscription {:keys [conn schema]} {:keys [topic group]})

Try to take the session advisory lock for the subscription for topic/group on conn, without waiting. Returns the subscription's sid if this session now holds the lock, or nil if another session holds it or there is no such subscription. Each success must be matched by one unlock-subscription (or by closing the session).

Try to take the session advisory lock for the subscription for
topic/group on `conn`, without waiting. Returns the subscription's `sid`
if this session now holds the lock, or nil if another session holds it
or there is no such subscription. Each success must be matched by one
`unlock-subscription` (or by closing the session).
sourceraw docstring

unlock-subscriptionclj

(unlock-subscription {:keys [conn]} sid)

Release the session advisory lock taken by try-lock-subscription for the subscription with sid.

Release the session advisory lock taken by `try-lock-subscription` for
the subscription with `sid`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close