daml/ledger-service
Stephen Compall 1388ebd695 compile ValuePredicates to SQL and run json-api queries in Postgres (#3599)
* toSqlWhereClause WIP

* literal cases for SQL predicate generation

* fill in the remaining Literals' sql-equal data

* add other likely elements of the toSqlWhereClause fold

* SQL ListMatch case

* SQL VariantMatch case

* partial SQL RecordSubset case

* SQL Range case

* comments on JSON encoding for DB

* new relationship for the 3 paths in toSqlWhereClause Rec

- conversion to Fragment is further delayed to allow mixed-mode matching
  of records

* handle new Rec semantics in ListMatch (can't drop @> on the floor anymore)

* compile RecordSubset to SQL

* compile MapMatch to SQL

* note optimization for record & map

* optimize = when @> unavailable for record subsets

* optimize range when degenerately =

* don't discard the @> safety of empty test sets

* unnested SQL optional matching

* converting DB JSON to response body JSON

* compiling nested optionals to SQL

* add missing length check to ListMatch

* remove unneeded parens from generated predicates

* remove 1 = 1 leader from generated predicates

* test the generated SQL from toSqlWhereClause

* searchDb WIP

* searchDb integrated

* coerce party to text in selectContracts; log that query

* fixing query

* fixing scala formatting

* removing unused functions

* removing unused type alias

* checking a that search returned exactly what we searched for,

also checking that all contracts got stored in the DB

* factor commonalities of MapMatch and RecordSubset

* cleanup

* cleanup

* changelog

CHANGELOG_BEGIN

- [JSON API - Experimental] Queries will always run against Postgres if Postgres is
  configured.  See `issue #3388 <https://github.com/digital-asset/daml/issues/3388>`_.

CHANGELOG_END

* fix record =-unsafe detection
2019-12-05 11:15:01 -05:00
..
db-backend compile ValuePredicates to SQL and run json-api queries in Postgres (#3599) 2019-12-05 11:15:01 -05:00
http-json compile ValuePredicates to SQL and run json-api queries in Postgres (#3599) 2019-12-05 11:15:01 -05:00
jwt Implement support for RSA-signed JWT tokens (#3526) 2019-11-25 16:29:24 +01:00
lf-value-json Extractor: Add support for GenMap (#3614) 2019-11-28 12:31:28 +00:00
utils Spin off TokenHolder into a new library (#3741) 2019-12-05 12:31:14 +00:00