eventually-rs icon indicating copy to clipboard operation
eventually-rs copied to clipboard

eventually-postgres: crate documentation in eventually

Open ar3s3ru opened this issue 5 years ago • 2 comments

The documentation for eventually-postgres is not visible in the public crate documentation.

As a result, users interested in using the Postgres EventStore implementation don't know how to.

From #116

ar3s3ru avatar Oct 05 '20 09:10 ar3s3ru

Just a thought, but I'd find it really useful to have a version of the example app that was easy to get running locally w/ a postgres event store. Going through the current docs I can't quite grok if/how a "real" app would need to think about things like schema migrations etc.

I think Ideally you'd be able to just docker-compose up the example app and then poke around in the postgres DB.

Something along these lines:

# .env
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_DB=eventually-app-example-db
# docker-compose.yml
version: '3'
services:

  example_db:
    container_name: "example-db"
    image: "postgres"
    ports:
      - "5432:5432"
    env_file:
      - .env
    volumes:
      - database-data:/var/lib/postgresql/data/ # persist data even if container shuts down

  example_app:
    container_name: "example-app"
    build: .
    depends_on:
      - example_db
    ports:
      - "8080:8080"
    env_file:
      - .env
    
volumes:
  database-data:

pseudo-su avatar Oct 05 '20 10:10 pseudo-su

Hey @pseudo-su :wave:

Yes, initially the example app was running using Postgres.

However, since it's hard to test many of the components in the crate, I wrote integration tests targeting the example app to contribute to the overall crate coverage.

This means that, running integration tests now easily, both locally and on Github Actions, it's a tad more complicated.

I'll figure something out and use Postgres :smile:


In general, however, I'd like to have documentation that is clear and bespoke enough for you not to poke around the example app too much to get up and running.

So that's definitely also part of documentation :sweat_smile:

ar3s3ru avatar Oct 05 '20 10:10 ar3s3ru