From 3dd31307563576031e11607f04547d3a6fc84344 Mon Sep 17 00:00:00 2001 From: vlad Date: Thu, 25 Jan 2018 14:13:07 -0800 Subject: Extracting query library --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 74faee6..a0d1c11 100644 --- a/README.md +++ b/README.md @@ -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") +) +``` -- cgit v1.2.3