A spring boot application using postgreSQL and java 11. The project is used for learning purposes of how to build and structure an application.
- Java 11
- PostgreSQL
- Spring boot
In the terminal: Start psql locally and enter the psql CLI
psql -h localhostCreate the student database instance
CREATE DATABASE studentGrant yourself all privileges to the database
GRANT ALL PRIVILEGES ON DATABASE "student" TO [insert your local username]Get an overview over the current roles and permissions in the different postgreSQL databases
\lConnecting to the student database
\c studentRun the project
- The @Table annotations should come into effect, and tell the database how to map student
Get an overview over the current scheme in the student db
7. select * from student; - This can also be viewed on this URL when the server is running: http://localhost:8080/api/v1/student
- ####PostgreSQL
brew install postgresql brew services restart postgresql - ####Postman
- To use and test the different API calls:
- GET: http://localhost:8080/api/v1/student
- Getting all students
- POST: http://localhost:8080/api/v1/student
- Needs a student payload to be sent with the call
- DELETE: http://localhost:8080/api/v1/student/1
- 1 is the ID of the student to be deleted
- PUT: http://localhost:8080/api/v1/student/1?name=Johan&[email protected]
- This call requires a name and email to be available update parameters
- GET: http://localhost:8080/api/v1/student
PGAdmin - to see the database changes live instead of having to use the terminal and querying every time.
- IntelliJ Ultimate has this functionality build in.
- To use and test the different API calls: