| package common; |
| |
| message ValuePb { |
| oneof value { |
| string string = 1; |
| int64 int = 2; |
| uint64 uint = 3; |
| double double = 4; |
| bytes bytes = 5; |
| bool bool = 6; |
| int64 timestamp = 7; |
| } |
| } |
| |
| message ColumnPb { |
| required string name = 1; |
| optional ValuePb value = 2; |
| optional int32 type = 3; |
| } |
| |
| message ChangePb { |
| // operation -- May be 1, 2, 3 for insert, update, or delete |
| required int32 operation = 1; |
| // Table name, in "schema.table" format |
| required string table = 2; |
| // Sequence number is generated by the change server by combining |
| // the commitSequence and commitIndex |
| optional string sequence = 3; |
| // LSN when the transaction was committed. Primary sort order. |
| optional uint64 commitSequence = 4; |
| // LSN when the change was made. Mostly of academic interest. |
| optional uint64 changeSequence = 5; |
| // Order in which the change was made inside the transaction. |
| // Secondary sort order. |
| optional uint32 commitIndex = 6; |
| // 32-bit Postgres transaction ID. Not used by newer code. |
| // Rolls over. |
| optional uint32 transactionID = 7; |
| // Row added to an insert, or new row for an update. |
| repeated ColumnPb newColumns = 8; |
| // Row removed on a delete, or old row for an update. |
| repeated ColumnPb oldColumns = 9; |
| // Time when the record was inserted, in seconds since the |
| // Unix epoch. |
| optional int64 timestamp = 10; |
| // 64-bit Postgres transaction id, including the epoch. Will not |
| // roll over. |
| optional uint64 transactionIDEpoch = 11; |
| } |
| |
| message ChangeListPb { |
| optional string lastSequence = 1; |
| optional string firstSequence = 2; |
| repeated ChangePb changes = 3; |
| } |
| |
| message SnapshotHeaderPb { |
| required string timestamp = 1; |
| required string snapshot = 2; |
| } |
| |
| message TableHeaderPb { |
| required string name = 1; |
| repeated ColumnPb columns = 2; |
| } |
| |
| message RowPb { |
| repeated ValuePb values = 1; |
| } |
| |
| message StreamMessagePb { |
| oneof message { |
| TableHeaderPb table = 1; |
| RowPb row = 2; |
| } |
| } |