3 ms·
You need an SQL optimizer to efficiently abstract over sql. There are a couple implementations, empirically producing good sql at runtime is kinda slow. The pa
by Tarean 6y ago
You need an SQL optimizer to efficiently abstract over sql. There are a couple implementations, empirically producing good sql at runtime is kinda slow.
The pathfinder compiler is meant for C# linq to mix sql and XML queries. It has backends in a couple languages but is kinda slow, and iirc has no support for aggregates.
Database Supported Haskell builds on this but has support for basically all sql features and some no-sql backends. Needs some slight work to fix bit rot by now, and the compiler is kinda slow. https://hackage.haskell.org/package/DSH https://hackage.haskell.org/package/DSH
The Ur language has great support for SQL, including updateable views. https://en.wikipedia.org/wiki/Ur_(programming_language) https://en.wikipedia.org/wiki/Ur_(programming_language)
TL;DR: If you allow general nested results in your abstraction you need an optimizer. Optimizing aggregates in general is REALLY hard and slow.
- throwaway_pdp09 6y agoIf you do mere joins, you need an optimiser.