diff options
author | vlad <vlad@driver.xyz> | 2018-01-25 14:13:07 -0800 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2018-01-25 14:13:07 -0800 |
commit | 3dd31307563576031e11607f04547d3a6fc84344 (patch) | |
tree | 11a948bb4794a404404c12dc61000829735ed6bd /README.md | |
parent | a0877d81ca2844d75dc361b5ce7c99afacd6e25f (diff) | |
download | rest-query-3dd31307563576031e11607f04547d3a6fc84344.tar.gz rest-query-3dd31307563576031e11607f04547d3a6fc84344.tar.bz2 rest-query-3dd31307563576031e11607f04547d3a6fc84344.zip |
Extracting query library
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,19 @@ -# PDS UI Common Library +# REST Query library -To make a change, create a PR, merge to master, do `sbt scalafmt`, follow instructions. +Allows to read queries from the REST requests (query parameters) and map them to the typed SQL Slick queries. +Supports ANDs and ORs, pagination and sorting. + +Queries can be build in the code as well (e.g., for testing): + +``` +SearchFilterExpr.Atom.NAry("id", In, objects.map(x => Long.box(x.id))) +``` + +or + +``` +SearchFilterExpr.Union(Seq( + SearchFilterExpr.Atom.Binary("status", Eq, "New"), + SearchFilterExpr.Atom.Binary("status", Eq, "Verified") +) +``` |