Skip to content

eatoncns/servant-typed-db

Repository files navigation

typed-db

A minimal example of constructing a JSON api in haskell using servant and postgresql-typed. The api serves a single endpoint at /users.

Database migrations are configured using sqitch.

Example test makes use of pg_tmp to spin up a temp db for test.

Pre-requisites

Initial setup is a little manual at this point. The following need to be installed prior to dev work:

  • Haskell stack
  • Running postgresql instance
  • Environment variable DB_URI set to database URI
  • Environment variables set for postgresql-typed as described here
  • sqitch

Assuming that postgres is running at default port the following command will migrate db:

sqitch deploy

Running

stack run - to run server

stack build - to compile server

stack test - run tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published