You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/HOWTO_USE_POSTGRESQL.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,19 @@
3
3
To use Postgresql, follow these steps:
4
4
5
5
1. Either install docker (recommended) or postgresql on your machine:
6
-
* If you installed docker run the database using: `docker compose up`
7
-
* If you installed postgres locally, create the spoke dev database: `psql -c "create database spokedev;"`
8
-
* Then create a spoke user to connect to the database with `createuser -P spoke` with password "spoke" (to match the credentials in the .env.example file)
6
+
* If you installed docker run the database using: `docker-compose up`
7
+
* If you installed postgres locally (or if you already have a local installation of postgres), create the spoke dev database: `psql -c "create database spokedev;"`
8
+
* Then create a spoke user to connect to the database with `psql -d spokedev -c "create user spoke with password 'spoke';"` (to match the credentials in the .env.example file)
9
+
* Grant permissions to the new Spoke user:
10
+
*`psql -d spokedev -c "GRANT ALL PRIVILEGES ON DATABASE spokedev TO spoke;"`
11
+
*`psql -d spokedev -c "GRANT ALL PRIVILEGES ON schema public TO spoke;"`
12
+
* Create a test database by running the following commands:
13
+
```
14
+
psql -d spokedev
15
+
CREATE DATABASE spoke_test;
16
+
CREATE USER spoke_test WITH PASSWORD 'spoke_test';
17
+
GRANT ALL PRIVILEGES ON DATABASE spoke_test TO spoke_test;
18
+
```
9
19
1. In `.env` set `DB_TYPE=pg`. (Otherwise, you will use sqlite.)
10
20
2. Set `DB_PORT=5432`, which is the default port for Postgres.
0 commit comments