April 2020
Intermediate to advanced
292 pages
6h 50m
English
Let’s start by examining the write_message[31] function signature that the Eventide schema provides:
| | CREATE OR REPLACE FUNCTION write_message( |
| | _id varchar, |
| | _stream_name varchar, |
| | _type varchar, |
| | _data jsonb, |
| | _metadata jsonb DEFAULT NULL, |
| | _expected_version bigint DEFAULT NULL |
| | ) |
This is a user-defined function and is the write interface that Message DB gives us. From this, we can tell that when writing a message, we supply the id, streamName, type, data, and metadata properties. The last parameter this function receives, _expected_version, is used when we’re implementing optimistic concurrency control later in this chapter under Adding Optimistic Concurrency Control to Our Writes. Our job then ...
Read now
Unlock full access