BetSmartMedia/gesundheit — pull request #56 by grncdr (2013-09-06 22:10:57+00:00)
Title: Browserify WIP

This s not ready for merge, but meant to track progress on some ideas I have.

The motivation is to allow client-side javascript to use the gesundheit API to simplify interactive query building.

The architecture I have in mind is to make gesundheit browserify-able and support marshalling/unmarshalling queries from JSON objects. Then a client-side application can build any possible gesundheit query, turn it into JSON and send it over the wire to the server. The server can then unmarshal it into a Query object, execute it, and send back the results. This much already works, but there are some outstanding issues:

- [ ] Security. The server will need to restrict and/or validate the data to be unmarshalled into a query. Because unmarshalling involves a recursive walk over a (parsed) JSON object, it should be possible to plug in a validation visitor that restricts what node types can be unmarshalled (as well as anything else about those nodes, e.g. restrict the tables and columns a particular user has access to).
- [ ] Client-side engine. It would be cool if the client-side JavaScript could actually call `.execute` on a query object, and this would automatically send a request in a predefined format to a user-configurable URL.