Module: Pgoutput::Messages
- Defined in:
- lib/pgoutput/messages.rb
Overview
Immutable message model classes for the PostgreSQL pgoutput protocol.
Every value returned by the parser is deeply shareable via ‘Ractor.make_shareable`. These classes are protocol-level structures only; they preserve tuple bytes and metadata but do not convert PostgreSQL values into application-specific Ruby types.
Defined Under Namespace
Classes: Begin, Column, Commit, Delete, Insert, Message, Origin, Relation, Truncate, TupleValue, Type, Update
Instance Attribute Summary collapse
-
#columns ⇒ Array<Column>
readonly
Immutable column metadata.
-
#commit_lsn ⇒ Integer
readonly
Commit LSN.
-
#commit_timestamp ⇒ Integer
readonly
Microseconds since PostgreSQL epoch.
-
#content ⇒ String
readonly
Immutable raw message content.
-
#final_lsn ⇒ Integer
readonly
Final transaction LSN.
-
#flags ⇒ Integer
readonly
Commit flags; currently unused by PostgreSQL.
-
#format ⇒ :null, ...
readonly
Protocol value format.
-
#lsn ⇒ Integer
readonly
LSN of the logical decoding message.
-
#name ⇒ String
readonly
Type name.
-
#new_tuple ⇒ Array<TupleValue>
readonly
New tuple data.
-
#oid ⇒ Integer?
readonly
PostgreSQL type OID when relation metadata is known.
-
#old_key_tuple ⇒ Array<TupleValue>?
readonly
Replica identity key tuple.
-
#old_tuple ⇒ Array<TupleValue>?
readonly
Full old tuple when replica identity is FULL.
-
#options ⇒ Integer
readonly
Option bits; 1 is CASCADE, 2 is RESTART IDENTITY.
-
#origin_lsn ⇒ Integer
readonly
Commit LSN on the origin server.
-
#prefix ⇒ String
readonly
Message prefix.
-
#raw ⇒ String?
readonly
Immutable raw payload, or nil for NULL/TOAST markers.
-
#relation_id ⇒ Integer
readonly
Relation OID.
-
#relation_ids ⇒ Array<Integer>
readonly
Relation OIDs affected by the truncate.
-
#replica_identity ⇒ Integer
readonly
Relation replica identity setting.
-
#schema ⇒ String
readonly
Namespace name.
-
#table ⇒ String
readonly
Relation name.
-
#transaction_end_lsn ⇒ Integer
readonly
Transaction end LSN.
-
#tuple ⇒ Array<TupleValue>
readonly
New tuple data.
-
#type_modifier ⇒ Integer
readonly
PostgreSQL type modifier.
-
#xid ⇒ Integer
readonly
Transaction id.
Instance Attribute Details
#columns ⇒ Array<Column> (readonly)
Returns immutable column metadata.
67 |
# File 'lib/pgoutput/messages.rb', line 67 Relation = Data.define(:relation_id, :schema, :table, :replica_identity, :columns) |
#commit_lsn ⇒ Integer (readonly)
Returns commit LSN.
142 |
# File 'lib/pgoutput/messages.rb', line 142 Commit = Data.define(:flags, :commit_lsn, :transaction_end_lsn, :commit_timestamp) |
#commit_timestamp ⇒ Integer (readonly)
Returns microseconds since PostgreSQL epoch.
21 |
# File 'lib/pgoutput/messages.rb', line 21 Begin = Data.define(:final_lsn, :commit_timestamp, :xid) |
#content ⇒ String (readonly)
Returns immutable raw message content.
33 |
# File 'lib/pgoutput/messages.rb', line 33 Message = Data.define(:flags, :lsn, :prefix, :content) |
#final_lsn ⇒ Integer (readonly)
Returns final transaction LSN.
21 |
# File 'lib/pgoutput/messages.rb', line 21 Begin = Data.define(:final_lsn, :commit_timestamp, :xid) |
#flags ⇒ Integer (readonly)
Returns commit flags; currently unused by PostgreSQL.
33 |
# File 'lib/pgoutput/messages.rb', line 33 Message = Data.define(:flags, :lsn, :prefix, :content) |
#format ⇒ :null, ... (readonly)
Returns protocol value format.
87 |
# File 'lib/pgoutput/messages.rb', line 87 TupleValue = Data.define(:format, :raw, :oid) |
#lsn ⇒ Integer (readonly)
Returns LSN of the logical decoding message.
33 |
# File 'lib/pgoutput/messages.rb', line 33 Message = Data.define(:flags, :lsn, :prefix, :content) |
#name ⇒ String (readonly)
Returns type name.
41 |
# File 'lib/pgoutput/messages.rb', line 41 Origin = Data.define(:origin_lsn, :name) |
#new_tuple ⇒ Array<TupleValue> (readonly)
Returns new tuple data.
110 |
# File 'lib/pgoutput/messages.rb', line 110 Update = Data.define(:relation_id, :old_key_tuple, :old_tuple, :new_tuple) |
#oid ⇒ Integer? (readonly)
Returns PostgreSQL type OID when relation metadata is known.
53 |
# File 'lib/pgoutput/messages.rb', line 53 Column = Data.define(:flags, :name, :oid, :type_modifier) |
#old_key_tuple ⇒ Array<TupleValue>? (readonly)
Returns replica identity key tuple.
110 |
# File 'lib/pgoutput/messages.rb', line 110 Update = Data.define(:relation_id, :old_key_tuple, :old_tuple, :new_tuple) |
#old_tuple ⇒ Array<TupleValue>? (readonly)
Returns full old tuple when replica identity is FULL.
110 |
# File 'lib/pgoutput/messages.rb', line 110 Update = Data.define(:relation_id, :old_key_tuple, :old_tuple, :new_tuple) |
#options ⇒ Integer (readonly)
Returns option bits; 1 is CASCADE, 2 is RESTART IDENTITY.
130 |
# File 'lib/pgoutput/messages.rb', line 130 Truncate = Data.define(:relation_ids, :options) |
#origin_lsn ⇒ Integer (readonly)
Returns commit LSN on the origin server.
41 |
# File 'lib/pgoutput/messages.rb', line 41 Origin = Data.define(:origin_lsn, :name) |
#prefix ⇒ String (readonly)
Returns message prefix.
33 |
# File 'lib/pgoutput/messages.rb', line 33 Message = Data.define(:flags, :lsn, :prefix, :content) |
#raw ⇒ String? (readonly)
Returns immutable raw payload, or nil for NULL/TOAST markers.
87 |
# File 'lib/pgoutput/messages.rb', line 87 TupleValue = Data.define(:format, :raw, :oid) |
#relation_id ⇒ Integer (readonly)
Returns relation OID.
67 |
# File 'lib/pgoutput/messages.rb', line 67 Relation = Data.define(:relation_id, :schema, :table, :replica_identity, :columns) |
#relation_ids ⇒ Array<Integer> (readonly)
Returns relation OIDs affected by the truncate.
130 |
# File 'lib/pgoutput/messages.rb', line 130 Truncate = Data.define(:relation_ids, :options) |
#replica_identity ⇒ Integer (readonly)
Returns relation replica identity setting.
67 |
# File 'lib/pgoutput/messages.rb', line 67 Relation = Data.define(:relation_id, :schema, :table, :replica_identity, :columns) |
#schema ⇒ String (readonly)
Returns namespace name.
67 |
# File 'lib/pgoutput/messages.rb', line 67 Relation = Data.define(:relation_id, :schema, :table, :replica_identity, :columns) |
#table ⇒ String (readonly)
Returns relation name.
67 |
# File 'lib/pgoutput/messages.rb', line 67 Relation = Data.define(:relation_id, :schema, :table, :replica_identity, :columns) |
#transaction_end_lsn ⇒ Integer (readonly)
Returns transaction end LSN.
142 |
# File 'lib/pgoutput/messages.rb', line 142 Commit = Data.define(:flags, :commit_lsn, :transaction_end_lsn, :commit_timestamp) |
#tuple ⇒ Array<TupleValue> (readonly)
Returns new tuple data.
95 |
# File 'lib/pgoutput/messages.rb', line 95 Insert = Data.define(:relation_id, :tuple) |
#type_modifier ⇒ Integer (readonly)
Returns PostgreSQL type modifier.
53 |
# File 'lib/pgoutput/messages.rb', line 53 Column = Data.define(:flags, :name, :oid, :type_modifier) |
#xid ⇒ Integer (readonly)
Returns transaction id.
21 |
# File 'lib/pgoutput/messages.rb', line 21 Begin = Data.define(:final_lsn, :commit_timestamp, :xid) |