File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 22
33This example shows how to access a PostgreSQL database from Spin component.
44
5+ ## Prerequisite: Postgres
6+
7+ This example assumes postgres is running and accessible locally via its standard 5432 port.
8+
9+ We suggest running the ` postgres ` Docker container which has the necessary postgres user permissions
10+ already configured. For example:
11+
12+ ```
13+ docker run --rm -h 127.0.0.1 -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres
14+ ```
15+
516## Spin up
617
7- From example root:
18+ Then, run the following from the root of this example :
819
920```
21+ export PGUSER=postgres PGHOST=localhost
1022createdb spin_dev
1123psql -d spin_dev -f db/testdata.sql
1224RUST_LOG=spin=trace spin build --up
Original file line number Diff line number Diff line change 22
33This example shows how to access a PostgreSQL database from Spin component.
44
5+ ## Prerequisite: Postgres
6+
7+ This example assumes postgres is running and accessible locally via its standard 5432 port.
8+
9+ We suggest running the ` postgres ` Docker container which has the necessary postgres user permissions
10+ already configured. For example:
11+
12+ ```
13+ docker run --rm -h 127.0.0.1 -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres
14+ ```
15+
516## Spin up
617
7- From example root:
18+ Then, run the following from the root of this example :
819
920```
21+ export PGUSER=postgres PGHOST=localhost
1022createdb spin_dev
1123psql -d spin_dev -f db/testdata.sql
1224RUST_LOG=spin=trace spin build --up
You can’t perform that action at this time.
0 commit comments