seql intends to provide a simplified EQL inspired query language to access entities stored in traditional SQL databases.
[[exoscale/seql "0.1.2"]]
Accessing SQL entities is often done based on a pre-existing schema. In most designs, applications strive to limit the number of ways mutations should happen on SQL. However, queries often need to be very flexible in the type of data they return as well in the number of joins performed.
With this rationale in mind, seql was built to provide:
On top of this, the schema syntax support creating compound fields as well as normalizing data to provide for more idiomatic Clojure data in query results
(query env
:account
[:account/name
:account/state
{:account/users [:user/email]}])
;; =>
[#:account{:name "org1"
:state :active
:users [#:user{:email "first@example.com"}
#:user{:email "second@example.com"}]}
#:account{:name "org2"
:state :suspended
:users [#:user{:email "bad@example.com"}
#:user{:email "worst@example.com"}]}]
(mutate! env
:account/new-organization
#:account{:name "org3"
:users [#:user{:email "hello@example.com"}]})
seql is built on top of honeysql and makes that dependency apparent in some case, particularly for mutations.
seql provides two introductory documents to get started with designing schemas and queries incrementally, as well as full API documentation. All are available on the documentation website.
Minor fixes for errors spotted by eastwood.
Inital release.
This project was greatly inspired by @wilkerlucio's work on pathom and subsequently EQL. As a first consumer of this library @davidjacot also help iron out a few kinks and made some significant improvements.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close