serviette: JSON to raw Sql string

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Use json to query the database and receive results


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6
Change log None available
Dependencies aeson, base (>=4.7 && <5), bytestring (>=0.9 && <0.11), generic-deriving, text (>=0.11 && <2.0) [details]
License BSD-3-Clause
Copyright 2017 Sasa Bogicevic
Author Sasa Bogicevic
Maintainer brutallesale@gmail.com
Category Web
Home page https://github.com/v0d1ch/serviette#readme
Source repo head: git clone https://github.com/v0d1ch/serviette
Uploaded by v0d1ch at 2017-06-17T12:19:35Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for serviette-0.1.0.3

[back to package description]

SERVIETTE - SQL JSON API

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

Why ?

Expected JSON format

{
	"format":1,
    "action":"SELECT",
    "selectName": "users",
    "joinTables":[
    	  {"tablename":"addresses","field":"userid","operator":"=","withTable":"users", "withField":"id"},
          {"tablename":"posts","field":"userid","operator":"=","withTable":"users", "withField":"id"}
    	],
    "whereCondition":[
          {"whereTableName":"users","whereField":"id", "whereOperator":">", "whereFieldValue": 1}
      ]
}

If format is set to 1 you will get raw sql string back, something like this: