Skip to content

An example with description how to access database from Play application

Notifications You must be signed in to change notification settings

NovaLite-doo/PlaySlickExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Play Slick with PostgreSQL database

An example how to access database from Scala Play application using Slick library.

Get started

Step 1

Run PostgreSQL and pgAdmin containers. There is docker-compose.yml file included

docker-compose up -d
  1. Open pgAdmin in browser
  2. Add new server
    • Host name/address = postgres_container (name of docker container)
    • Port = 5432 (exposed port)

Step 2

Run Scala Play application. 9000 is default port, you can change it.

sbt "run 9000"

SQL scripts from conf/evolutions folder will be executed when application is started.

Open application index page. It will render swagger documentation.

Enjoy!

About

An example with description how to access database from Play application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published