- Make sure Postgres is running locally with default settings (see instructions below)
- Run
com/davidagood/kotlinspringbootjpa/KotlinSpringBootJpaStarterApplication.kt
or run./gradlew bootRun
- Starts @ http://localhost:8080
- Supports basic CRUD operations:
GET /relation
POST /relation?parent=<parentId>&child=<childId>
DELETE /relation
- Supports seeding an arbitrary number of relations:
POST /seed/{count}
Run ./gradlew build
docker run -d --name kotlin-sb-jpa-starter -v kotlin-sb-jpa-starter-data:/var/lib/postgresql/data -p 5432:5432 postgres:latest
docker logs -f kotlin-sb-jpa-starter
docker exec -it kotlin-sb-jpa-starter psql -U postgres
\l
to list databasesCREATE DATABASE test;
\c test
to change totest
databaseINSERT INTO relation(id, parentId, childId) VALUES (2, 2, 3);
INSERT INTO relation(id, parentId, childId, createdAt) VALUES (1, 1, 2, timezone('UTC'::text, now()));
SELECT * FROM relation;