All Projects → graphqlize → Honeyeql

graphqlize / Honeyeql

Licence: epl-2.0
HoneyEQL is a Clojure library enables you to query database using the EDN Query Language.

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Honeyeql

Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (+245.95%)
Mutual labels:  mysql, postgresql, edn
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+16267.57%)
Mutual labels:  mysql, postgresql
Bireme
Bireme is an incremental synchronization tool for the Greenplum / HashData data warehouse
Stars: ✭ 110 (-0.9%)
Mutual labels:  mysql, postgresql
Adminer Custom
Customizations for Adminer, the best database management tool written in PHP.
Stars: ✭ 99 (-10.81%)
Mutual labels:  mysql, postgresql
Xeus Sql
xeus-sql is a Jupyter kernel for general SQL implementations.
Stars: ✭ 85 (-23.42%)
Mutual labels:  mysql, postgresql
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+1038.74%)
Mutual labels:  mysql, postgresql
Leoric
👑 JavaScript ORM for MySQL, PostgreSQL, and SQLite.
Stars: ✭ 94 (-15.32%)
Mutual labels:  mysql, postgresql
Agent
The best way to backup and restore your database
Stars: ✭ 80 (-27.93%)
Mutual labels:  mysql, postgresql
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-8.11%)
Mutual labels:  mysql, postgresql
Docker Laravel
🐳 Docker Images for Laravel development
Stars: ✭ 101 (-9.01%)
Mutual labels:  mysql, postgresql
Xgenecloud
XgeneCloud is now https://github.com/nocodb/nocodb
Stars: ✭ 1,629 (+1367.57%)
Mutual labels:  mysql, postgresql
Gopherus
This tool generates gopher link for exploiting SSRF and gaining RCE in various servers
Stars: ✭ 1,258 (+1033.33%)
Mutual labels:  mysql, postgresql
Chloe
A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C#
Stars: ✭ 1,248 (+1024.32%)
Mutual labels:  mysql, postgresql
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+1041.44%)
Mutual labels:  mysql, postgresql
Sql
MySQL & PostgreSQL pipe
Stars: ✭ 81 (-27.03%)
Mutual labels:  mysql, postgresql
Qtl
A friendly and lightweight C++ database library for MySQL, PostgreSQL, SQLite and ODBC.
Stars: ✭ 92 (-17.12%)
Mutual labels:  mysql, postgresql
Haproxy Configs
80+ HAProxy Configs for Hadoop, Big Data, NoSQL, Docker, Elasticsearch, SolrCloud, HBase, MySQL, PostgreSQL, Apache Drill, Hive, Presto, Impala, Hue, ZooKeeper, SSH, RabbitMQ, Redis, Riak, Cloudera, OpenTSDB, InfluxDB, Prometheus, Kibana, Graphite, Rancher etc.
Stars: ✭ 106 (-4.5%)
Mutual labels:  mysql, postgresql
Luigi Warehouse
A luigi powered analytics / warehouse stack
Stars: ✭ 72 (-35.14%)
Mutual labels:  mysql, postgresql
Node Sql Fixtures
SQL fixtures for Node.js in PostgreSQL, MySQL, MariaDB and SQLite
Stars: ✭ 76 (-31.53%)
Mutual labels:  mysql, postgresql
Openseedbox
OpenSeedbox - Open Source Multi-User Bittorrent Web UI
Stars: ✭ 101 (-9.01%)
Mutual labels:  mysql, postgresql

HoneyEQL

HoneyEQL is a Clojure library enables you to query the database declaratively using the EDN Query Language(EQL). It aims to simplify the effort required to work with the relational databases in Clojure.

HoneyEQL powers GraphQLize.

Clojars Project

CAUTION: HoneyEQL is at its early stages now. It is not production-ready yet!. It currently supports Postgres (9.4 & above) and MySQL (8.0 & above) only.

Rationale

When a query involves more than one table, the declarative nature of SQL depreciates. Depends on the type of relationship, we have to put appropriate join conditions.

Let's assume that we have the following schema.

To get all the films of an actor with the id 148 along with his/her first name & last name, we have to query it as

(jdbc/execute! ds ["SELECT actor.first_name, actor.last_name, film.title
                    FROM actor
                    LEFT OUTER JOIN film_actor ON film_actor.actor_id = actor.actor_id
                    LEFT OUTER JOIN film ON film_actor.film_id = film.film_id
                    WHERE actor.actor_id = ?" 148])

The query result would look like

[{:actor/first_name "EMILY", :actor/last_name "DEE", :film/title "ANONYMOUS HUMAN"}
 {:actor/first_name "EMILY", :actor/last_name "DEE", :film/title "BASIC EASY"}
 {:actor/first_name "EMILY", :actor/last_name "DEE", :film/title "CHAMBER ITALIAN"}
 ...]

Then we need to group by first_name & last_name to get the exact result result that we want!

How about making these steps truly declarative?

With HoneyEQL, we can do it as

(heql/query-single 
  db-adapter  
  {[:actor/actor-id 148] 
   [:actor/first-name 
    :actor/last-name 
    {:actor/films 
     [:film/title]}]})

The above query yields the results in the exact-shape that we wanted and without any explicit data transformations.

{:actor/first-name "EMILY"
 :actor/last-name "DEE"
 :actor/films [{:film/title "ANONYMOUS HUMAN"}
               {:film/title "BASIC EASY"}
               {:film/title "CHAMBER ITALIAN"}
               ...]}

As the query syntax is made up of Clojure's data structures, we can construct it dynamically at runtime.

HoneyEQL transforms the EQL into single efficient SQL and query the database using next.jdbc.

Documentation

cljdoc badge

Acknowledgements

Walkable is the inspiration behind HoneyEQL.

HoneyEQL is not possible without the following excellent Clojure libraries.

The samples in the documentation of HoneyEQL uses the Sakila database from JOOQ extensively.

License

The use and distribution terms for this software are covered by the Eclipse Public License - v 2.0. By using this software in any fashion, you are agreeing to be bound by the terms of this license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].