Skip to content

Latest commit

 

History

History
53 lines (50 loc) · 1.11 KB

README.md

File metadata and controls

53 lines (50 loc) · 1.11 KB

Description

Playing with Spring Boot; practicing

  • CRUD
  • Authorisation
  • Integration testing with JGiven, TestContainers

Database Setup

I am assuming you want a disposible database like me. A database running in a docker container.

*** I chose not to write a dockerfile. I want you to SUFFER!!!!!!!!!!! ***

docker pull postgres
docker run --name <container_name> -e POSTGRES_PASSWORD=<password> -d -p 5432:5432 postgres
docker exec -it <containerName> psql -U postgres

To create a new db use,

CREATE USER <username> WITH PASSWORD '<password>';

If not you may use the default postgres User Create Database

CREATE DATABASE dbName OWNER <username>;

To list all DBs

\l

To quit

\q

To check if all is alright

    docker logs <containerName>

!!! Be sure to configure the application.properties file(./src/main/resources).

Check the data inside your database

docker exec -it <containerName> bash
psql -U <username> <databaseName>
SELECT * FROM <tableName>;