The servant-db package

[Tags:bsd3, library]

[Skip to Readme]

Properties

Versions 0.2.0.0, 0.2.0.1
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), servant (>=0.2 && <0.10) [details]
License BSD3
Copyright 2016 (c) Anton Gushcha
Author Anton Gushcha
Maintainer ncrashed@gmail.com
Uploaded Fri Oct 14 09:53:10 UTC 2016 by NCrashed
Distributions NixOS:0.2.0.1
Downloads 96 total (14 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for servant-db

Readme for servant-db-0.2.0.1

servant-db

The idea of package is to provide servant-like DSL for specifying an API for functions stored in RDBMS.

data RegisterUser = RegisterUser {
  userName :: Text
, userPassword :: Text
, userPhone :: Phone
, userEmail :: Email
}

type API = 
       ArgNamed "user" RegisterUser
    :> ArgNamed "isAdmin" Bool
    :> Procedure "registerUser" (Maybe (Only UserId))
  :<|> ArgPos UserId
    :> Procedure "getUser" (Maybe User)
  :<|> Procedure "listUsers" [User]

The library adds three custom combinators:

  • ArgNamed name a - named argument of stored function of type a.

  • ArgPos a - unamed argument of stored function of type a.

  • Procedure name a - named stored function with return type a.

Related libraries: