serviette: JSON to Sql

[ bsd3, deprecated, library, web ] [ Propose Tags ]

Use json to generate simple sql queries. I needed this for the work project and decided to implement it also in haskell. This could be used to query the database directly from frontend.

[Skip to Readme]


Maintainer's Corner

Package maintainers

  • No current members of group

For package maintainers and hackage trustees


Versions [RSS],,,,,, (info)
Dependencies aeson, base (>=4.7 && <5), bytestring (>=0.9 && <0.11), generic-deriving, text (>=0.11 && <2.0), text-show [details]
License BSD-3-Clause
Copyright 2017 Sasa Bogicevic
Author Sasa Bogicevic
Category Web
Home page
Source repo head: git clone
Uploaded by v0d1ch at 2017-06-24T20:59:55Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3261 total (35 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-06-24 [all 1 reports]

Readme for serviette-

[back to package description]

SERVIETTE - JSON to SQL Build Status

Library for generating SQL queries from JSON. Send the json in the expected format and receive raw sql string.

Why ?

  • Why not ?

Expected JSON format

    "selectName": "users",
    	  {"tablename":"addresses","field":"userid","operator":"=","withTable":"users", "withField":"id"},
          {"tablename":"posts","field":"userid","operator":"=","withTable":"users", "withField":"id"}
          {"whereTableName":"users","whereField":"id", "whereOperator":">", "whereFieldValue": 1}

If format is set to 1 you will get json response:

{"response":"SELECT users join addresses on userid =  join posts on userid =   where > 1","warnings":"","errors":""}

You can find this lib on hackage Serviette backend is here