@@ -26,11 +26,10 @@ $ pip install message-db-py
26
26
Clone the Message DB repository to set up the database:
27
27
28
28
``` shell
29
- git clone
[email protected] :message-db/message-db.git
29
+ $ git clone
[email protected] :message-db/message-db.git
30
30
```
31
31
32
- More detailed instructions are in the [ Installation]
33
- (https://github.com/message-db/message-db?tab=readme-ov-file#installation )
32
+ More detailed instructions are in the [ Installation] ( https://github.com/message-db/message-db?tab=readme-ov-file#installation )
34
33
section of Message DB repo.
35
34
36
35
Running the database installation script creates the database, schema, table,
@@ -42,7 +41,7 @@ repo. Change directory to the message-db directory where you cloned the repo,
42
41
and run the script:
43
42
44
43
``` shell
45
- database/install.sh
44
+ $ database/install.sh
46
45
```
47
46
48
47
Make sure that your default Postgres user has administrative privileges.
@@ -56,21 +55,21 @@ If you prefer either a different database name, you can override the name
56
55
using the ` DATABASE_NAME ` environment variable.
57
56
58
57
``` shell
59
- DATABASE_NAME=some_other_database database/install.sh
58
+ $ DATABASE_NAME=some_other_database database/install.sh
60
59
```
61
60
62
61
### Uninstalling the Database
63
62
64
63
If you need to drop the database (for example, on a local dev machine):
65
64
66
65
``` bash
67
- database/uninstall.sh
66
+ $ database/uninstall.sh
68
67
```
69
68
70
69
If you're upgrading a previous version of the database:
71
70
72
71
``` bash
73
- database/update.sh
72
+ $ database/update.sh
74
73
```
75
74
76
75
## Docker Image
@@ -97,7 +96,7 @@ Here's a quick example of how to publish and read messages using Message-DB-py:
97
96
from message_db import MessageDB
98
97
99
98
# Initialize the database connection
100
- store = MessageDB(CONN_URL )
99
+ store = MessageDB(CONNECTION_URL )
101
100
102
101
# Write a message
103
102
store.write(" user_stream" , " register" , {" name" : " John Doe" })
@@ -109,6 +108,10 @@ print(message)
109
108
110
109
## Primary APIs
111
110
111
+ - [ Write Messages] ( #write )
112
+ - [ Read Messages] ( #read-messages-from-a-stream-or-category )
113
+ - [ Read Last Message from stream] ( #read-last-message-from-stream )
114
+
112
115
### Write messages
113
116
114
117
The ` write ` method is used to append a new message to a specified stream within
@@ -231,6 +234,10 @@ else:
231
234
232
235
## Utility APIs
233
236
237
+ - [ Read Stream] ( #read-stream )
238
+ - [ Read Category] ( #read-category )
239
+ - [ Write Batch] ( #write-batch )
240
+
234
241
### Read Stream
235
242
236
243
The ` read_stream ` method retrieves a sequence of messages from a specified stream
0 commit comments