honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
seancorfield 2020-05-07T00:35:43.013700Z

@dcj What's a cross join and is it something specific to the database you are using? HoneySQL deliberately only supports ANSI SQL (with very few exceptions) and defers to community libraries to provide DB-specific SQL DSL elements.

seancorfield 2020-05-07T00:36:36.014100Z

For example, here's the PostgreSQL-specific extension library https://github.com/nilenso/honeysql-postgres

2020-05-07T00:52:49.016700Z

I am not a SQL expert by any stretch of the imagination, and I had never heard of this either until today. The complex multi-CTE query I'm attempting to code in Clojure/HoneySQL was written in SQL by a sophisticated SQL person. AFAICT, a cross join is not a Postgres-specific feature, some google searches seem to indicate that other databases support it as well.

In SQL, the CROSS JOIN is used to combine each row of the first table with each row of the second table. It is also known as the Cartesian join since it returns the Cartesian product of the sets of rows from the joined tables.

2020-05-07T00:56:53.017500Z

Also from the wikipedia article:

ANSI-standard SQL specifies five types of JOIN: INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER and CROSS

seancorfield 2020-05-07T01:22:19.017700Z

Hmm, interesting.

2020-05-07T01:24:20.017800Z

seancorfield 2020-05-07T01:24:28.018Z

https://github.com/jkk/honeysql/issues/257

seancorfield 2020-05-07T01:25:23.018800Z

That said, you can implement it yourself using HoneySQL today per https://github.com/jkk/honeysql#extensibility

2020-05-07T05:01:09.019500Z

@seancorfield Thanks, I will look into that!

2020-05-07T15:29:06.020800Z

2020-05-07T15:47:57.020900Z

2020-05-07T15:47:58.021Z