Skip to content

Commit

Permalink
Clean up documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
subhashb committed Apr 24, 2024
1 parent 83f0824 commit 5191b94
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ $ pip install message-db-py
Clone the Message DB repository to set up the database:

```shell
git clone [email protected]:message-db/message-db.git
$ git clone [email protected]:message-db/message-db.git
```

More detailed instructions are in the [Installation]
(https://github.com/message-db/message-db?tab=readme-ov-file#installation)
More detailed instructions are in the [Installation](https://github.com/message-db/message-db?tab=readme-ov-file#installation)
section of Message DB repo.

Running the database installation script creates the database, schema, table,
Expand All @@ -42,7 +41,7 @@ repo. Change directory to the message-db directory where you cloned the repo,
and run the script:

```shell
database/install.sh
$ database/install.sh
```

Make sure that your default Postgres user has administrative privileges.
Expand All @@ -56,21 +55,21 @@ If you prefer either a different database name, you can override the name
using the `DATABASE_NAME` environment variable.

```shell
DATABASE_NAME=some_other_database database/install.sh
$ DATABASE_NAME=some_other_database database/install.sh
```

### Uninstalling the Database

If you need to drop the database (for example, on a local dev machine):

``` bash
database/uninstall.sh
$ database/uninstall.sh
```

If you're upgrading a previous version of the database:

``` bash
database/update.sh
$ database/update.sh
```

## Docker Image
Expand All @@ -97,7 +96,7 @@ Here's a quick example of how to publish and read messages using Message-DB-py:
from message_db import MessageDB

# Initialize the database connection
store = MessageDB(CONN_URL)
store = MessageDB(CONNECTION_URL)

# Write a message
store.write("user_stream", "register", {"name": "John Doe"})
Expand All @@ -109,6 +108,10 @@ print(message)

## Primary APIs

- [Write Messages](#write)
- [Read Messages](#read-messages-from-a-stream-or-category)
- [Read Last Message from stream](#read-last-message-from-stream)

### Write messages

The `write` method is used to append a new message to a specified stream within
Expand Down Expand Up @@ -231,6 +234,10 @@ else:

## Utility APIs

- [Read Stream](#read-stream)
- [Read Category](#read-category)
- [Write Batch](#write-batch)

### Read Stream

The `read_stream` method retrieves a sequence of messages from a specified stream
Expand Down

0 comments on commit 5191b94

Please sign in to comment.