Skip to content

sumawa/zhttp-quill

Repository files navigation

ZIO-HTTP ZIO-QUILL Example

  • A very basic zio-http / zio-quill example
  • Demonstrates how to use a Db ZLayer implementing data access using zio-quill with zio-http
  • The example doesn't go deep into DB specific details (surrogate ids, constraints etc.)

Libraries used / Dependencies

  • zio version "1.0.13"
  • zio-quill versin "3.8.0"
  • h2 version "1.4.199"
  • zio-http version "1.0.0.0-RC19"

Artefacts:

Describe end points for

Build and run

  • The sample application is built in the form of assembly and executed with run script
sbt clean assembly
./run_zhttp_quill.sh
  • The server can be stopped running kill script
./kill_zhttp_quill.sh
  • The output is generated in the app.log
tail app.log

Example curl commands for testing

Inject dynamic UUID data by firing this POST endpoint 2 or more times (injecting new records)

curl  -X POST http://localhost:8090/person
Persons: List(Person(102,f7743392-68d2-4acc-b941-c870c0571134,27))%                                                                       

curl  -X POST http://localhost:8090/person
Persons: List(Person(102,f7743392-68d2-4acc-b941-c870c0571134,27), Person(102,fb594b9a-4e34-4a04-b013-2d9ad1fa47cf,27))

Get specific user by name

curl http://localhost:8090/user/f7743392-68d2-4acc-b941-c870c0571134

Hello: List(Person(102,f7743392-68d2-4acc-b941-c870c0571134,27))

Useful References

Possible Improvements (Overall TODOs):

About

Demo project showing usage of zio-http and zio-quill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published