Getting local postgres setup

master
Drew Bednar 3 weeks ago
parent cfbe01d866
commit 85b77d97e3

3
.gitignore vendored

@ -34,3 +34,6 @@ tmp/
# Postgres
.pg_data
# Profiles
.local-profile

@ -0,0 +1,5 @@
export POSTGRES_USER=myuser
export POSTGRES_PASSWORD=mypassword
export POSTGRES_DB=mydatabase
export PG_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5433/mydatabase

@ -2,7 +2,43 @@
Experimenting with River Async task system for background jobs in golang.
## Starting Local Dev
This project requires a running postgres database for River's task system.
To start a postgres database use:
```
make start-local
```
To stop it use:
```
make stop-local
```
A simple `.local-profile.template` is available with environment variables that can be helpful when working in this project.
```
cp .local-profile.template .local-profile
```
Update the profile with any additional envvars you will need then:
```
source .local-profile
```
You can now connect to the local database using `psql $PG_URI`
If you do not have `psql` installed:
```
brew install libpq
```
## Resources
- [Go Background Jobs with River Queue](https://www.youtube.com/watch?v=TC9fwhvzoMM&t=362s)

Loading…
Cancel
Save