A long held view of mine is that our current architecture where we keep logic on the server and data in the database is rather unfortunate, because it means you either have to<p>* marshall data to your server to process (which can be slow), or<p>* marshall code to your db to run (which can be messy, in part because you're translating from one programming language to your db's language - this is the main reason ORMs exist)<p>I always thought that the solution is to have all computation live in the DB (similar to how kdb does it), but this is pretty nice too. If you squint your eyes this looks like a much cleverer ORM.<p>It would be even better if the language supported SQL as a first class citizen, but that's not really an option here, since you're stuck with js.