SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

Read consumer bindings

Edit this page
Consumer · Related pages
Posted: 2026-09-16 · Report this thread
brandon Site Admin brandon profile Posts: 96
Get(ctx context.Context) (*Binding, error)
Bindings(ctx context.Context) ([]*Binding, error)

Get reads a consumer group’s effective binding declaration. System.Bindings lists effective declarations and outstanding declarations waiting to replace them, ordered by stream and group.

Example

Inspect the charge-cards group on the payments.requested stream with an initialized client. RawPayload is sufficient for this configuration read.

payments := client.Stream[sqlstreams.RawPayload]("payments.requested")
binding, err := payments.Consumer("charge-cards").Binding().Get(ctx)
if err != nil {
return err
}
if binding != nil {
fmt.Println(binding.Status, binding.Patterns)
}

Parameters

Parameter Type Required Description
ctx context.Context Yes Cancellation or its deadline interrupts the database read.

Returns

Operation and condition Return value
Get finds an effective declaration (binding, nil).
Get finds no stream, group, or binding declaration (nil, nil). A group that never declared bindings reads the whole stream.
Bindings finds declarations (bindings, nil), ordered by stream and group.
Bindings finds none (nil, nil).
Read fails A nil result and non-nil error.

Binding

Field Type JSON name Description
ConsumerGroupName string consumer_group The group declaring the binding set.
StreamName string stream The group’s stream.
Status BindingOutcome status The outcome of the declaration attempt.
Patterns []string patterns The complete routing pattern set. An empty set means the whole stream.
DeclaredBy string declared_by Identity of the declaring process.
DeclaredAt time.Time declared_at When the declaration was made.
AttemptedAt time.Time attempted_at When this declarer last attempted to install the set.

BindingOutcome

Constant Value Meaning
BindingInstalled "installed" The declaration became effective.
BindingJoined "joined" The declaration matched the effective set.
BindingWaiting "waiting" A different set remained in use by a live instance.

CLI

sqlstreams consumer binding get payments.requested charge-cards
sqlstreams system binding list

Both commands support --output json.

Errors

Error When
Validation error Get receives an empty stream or group name.
Database or context error The read fails or is interrupted.