44 KiB
Changes
-
2.7.next in progress
-
2.7.1295 -- 2025-03-12
- Address #570 by adding
:.:.as special syntax for Snowflake's JSON path syntax, and:atas special syntax for general[..]path syntax. - Drop support for Clojure 1.9 #561.
- Address #570 by adding
-
2.6.1281 -- 2025-03-06
- Address #568 by adding
honey.sql/semicolonto merge multiple SQL+params vectors into one (with semicolons separating the SQL statements). - Address #567 by adding support for
ASSERTclause. - Address #566 by adding
IS [NOT] DISTINCT FROMoperators. - Add examples of
:aliaswith:group-by(syntax is slightly different to existing examples for:order-by).
- Address #568 by adding
-
2.6.1270 -- 2025-01-17
- Fix autoboxing introduced in 2.6.1267 via PR #564 @alexander-yakushev.
-
2.6.1267 -- 2025-01-16
- Support expressions in
WITHclauses via PR #563 @krevedkokun. - More performance optimizations via PRs #560 and #562 @alexander-yakushev.
- Fix two broken links to the HoneySQL web app via PR #559 @whatacold.
- Make SQL Server dialect auto-lift Boolean values to parameters since SQL Server has no
TRUE/FALSEliterals. - Fix bug in
DEFAULTvalues clause (that omitted some values).
- Support expressions in
-
2.6.1243 -- 2024-12-13
- Address #558 by adding
:patch-into(andpatch-intohelper) for XTDB (but in core). - Address #556 by adding an XTDB section to the documentation with examples.
- Address #555 by supporting
SETTINGclause for XTDB. - Replace
assertcalls with proper validation, throwingex-infoon failure (like other existing validation in HoneySQL). - Experimental
:xtdbdialect removed (since XTDB no longer supports qualified column names). - Update dev/test deps.
- Address #558 by adding
-
2.6.1230 -- 2024-11-23
- Fix #553 by adding
:not-betweenas special syntax via PR #554 @plooney81 - Fix #552 by changing the assert-on-load behavior into an explicit test in the test suite.
- Fix #551 by supporting multiple
WINDOWclauses. - Fix #549 by using
:bbconditionals to support Babashka (and still support Clojure 1.9.0), and add testing against Babashka so it is fully-supported as a target via PR #550 @borkdude - Address #532 by adding support for XTDB SQL extensions
ERASE,EXCLUDE,OBJECT,RECORD,RECORDS, andRENAME, along with inline hash maps (as records) and:get-infor object navigation, and starting to write tests for XTDB compatibility.
- Fix #553 by adding
-
2.6.1203 -- 2024-10-22
-
2.6.1196 -- 2024-10-06
- Address #547 by adding examples of conditional SQL building with the helpers to the README and the
honey.sql.helpersns docstring. - Performance optimizations via PRs #545 and #546 @alexander-yakushev.
- Address #544 by adding support for MySQL's
VALUES ROW(..)syntax. - Fix #543 by supporting both symbols and keywords in named parameters.
- Address #541 by specifying the expected result of a formatter function passed to
register-clause!and adding the example from the README to Extending HoneySQL. - Getting Started updated based on feedback from Los Angeles Clojure meetup walkthrough #539.
- Fix #538 by removing
modfrom list of infix operators. - Fixed a few symbol/keyword resolution bugs in the formatter. Thanks to @irigarae.
- Update Clojure version to 1.12.0; update dev/test/ci deps.
- Address #547 by adding examples of conditional SQL building with the helpers to the README and the
-
2.6.1161 -- 2024-08-29
- Address #537 by ignoring non-scalar values in metadata, and expanding support to numbers, and checking strings for suspicious characters.
- Address #536 by noting what will not work with PostgreSQL (but works with other databases).
- Address #533 by adding
honey.sql/*escape-?*which can be bound tofalseto prevent?being escaped to??when used as an operator or function. - Address #526 by using
format-varin DDL, instead offormat-entity. - Update JDK test matrix (adopt -> temurin, 19 -> 21).
- Update Clojure versions (to 1.11.4 & 1.12.0-rc2).
-
2.6.1147 -- 2024-06-12
- Address #531 and #527 by adding tests and more documentation for
:composite; fix bug inset-dialect!where clause order is not restored. - Address #530 by adding support for
:using-ginto:create-index. - Address #529 by fixing
:joinspecial syntax to support aliases and to handle expressions the same wayselect/frometc handle them (extra[...]nesting). - Add example of mixed
DO UPDATE SETwithEXCLUDEDand regular SQL expressions. - Improve exception message when un-
lift-ed JSON expressions are used in the DSL. - Update Clojure versions (to 1.11.3 and 1.12.0-alpha12); update other dev/test dependencies.
- Address #531 and #527 by adding tests and more documentation for
-
2.6.1126 -- 2024-03-04
- Address #524 by adding example of
{:nest ..}in:unionclause reference docs. - Address #523 by expanding examples in README Functions to show aliases.
- Address #522 by supporting metadata on table specifications in
:fromand:joinclauses to provide index hints (SQL Server). Address #521 by adding initial experimental support for an XTDB dialect.[This was removed in 2.6.1243 since XTDB no longer supports qualified column names]- Address #520 by expanding how
:inlineworks, to support a sequence of arguments. - Fix #518 by moving temporal clause before alias.
- Address #495 by adding
formatvmacro (.cljonly!) -- and removing the experimentalformatffunction (added for discussion in 2.4.1045). - Implemented
CREATE INDEX#348 via PR #517 @dancek. - Mention
:not-inexplicitly in the documentation. - Code cleanup per
clj-kondo.
- Address #524 by adding example of
-
2.5.1103 -- 2023-12-03
- Address #515 by:
- Quoting entities that start with a digit but are otherwise alphanumeric. Note that entities that are all digits (optionally including underscores) will still not be quoted as in previous releases,
- Adding a new
:quoted-alwaysoption allows users to specify a regex that matches entities that should always be quoted (stropped) regardless of the value of:quoted(such as reserved words that you have used as column or table names).
- Address #513 by:
- Ignoring
:file,:line,:column,:end-line, and:end-columnmetadata keys (previously only:lineand:columnwere ignored), - Adding an
:ignored-metadataoption to allow additional keys to be ignored.
- Ignoring
- Address #515 by:
-
2.5.1091 -- 2023-10-28
- Address #512 by adding support for subqueries in the
:arrayspecial syntax (for BigQuery and PostgreSQL). This also adds support for metadata on the:selectvalue to produceAS STRUCTorDISTINCT. - Address #511 by adding support for BigQuery
CREATE OR REPLACE. - Address #510 by adding initial support for an NRQL dialect.
- Fix #509 by checking for
ident?before checking keyword/symbol.
- Address #512 by adding support for subqueries in the
-
2.4.1078 -- 2023-10-07
- Address #507 by clarifying formatting of
:castin Special Syntax. - Fix #505 by rewriting the helper merge function to handle both keywords and symbols properly.
- Address #503 by adding
:at-time-zonespecial syntax. - Address #504 for BigQuery support, by adding special syntax for ignore/respect nulls, as well as new
:distinctand:exprclauses to allow expressions to be qualified with SQL clauses. The latter will probably be useful for other dialects too. - Update
tools.buildto 0.9.6 (and get rid oftemplate/pom.xmlin favor of new:pom-dataoption tob/write-pom).
- Address #507 by clarifying formatting of
-
2.4.1066 -- 2023-08-27
- Add
:selectwith function call and alias example to README (PR #502 @markbastian). - Address #501 by making
INSERT INTO(andREPLACE INTO) use the:columnsor:valuesclauses to produce column names (which are then omitted from those other clauses). - Address #497 by adding
:aliasspecial syntax. - Address #496 by adding
:overriding-valueoption to:insertclause. - Address #407 by adding support for temporal queries (see
FROMin SQL Clause Reference). - Address #389 by adding examples of
[:only :table]producingONLY(table). - Add
:create-or-replace-viewto support PostgreSQL's lack ofIF NOT EXISTSforCREATE VIEW. - Attempt to clarify the formatting behavior of the
:valuesclause when used to produce column names. - Update
tools.buildto 0.9.5 (and remove:java-optssetting frombuild/run-task)
- Add
-
2.4.1045 -- 2023-06-25
- Address #495 by adding (experimental)
formatffunction -- note: this was removed in 2.6.1126, in favor of theformatvmacro. - Fix #494 by supporting expressions in
:on-conflictinstead of just entities. - Address #493 by clarifying use of
:valuesin CTEs (using:with). - Address #489 by adding more examples around
:update. - Attempt to improve
honey.sql.helpersnamespace docstring (by adding a note from the relevant Getting Started section). - Update dev/test dependencies.
- Address #495 by adding (experimental)
-
2.4.1033 -- 2023-05-22
- Tentative ClojureCLR support.
- Improve
on-conflicthelper docstring #490 @holyjak.
-
2.4.1026 -- 2023-04-15
- Fix #486 by supporting ANSI-style
INTERVALsyntax. - Fix #485 by adding
:with-ordinality"operator". - Fix #484 by adding
TABLEtoTRUNCATE. - Fix #483 by adding a function-like
:joinsyntax to produce nestedJOINexpressions. - Update
tools.build; split alias:test/:runnerfor friendlier jack-in UX while developing.
- Fix #486 by supporting ANSI-style
-
2.4.1011 -- 2023-03-23
-
2.4.1006 -- 2023-03-17
- Fix #478 by handling
:do-update-setcorrectly in theupserthelper and by handling parameters correctly in the:do-update-setformatter. - Fix #476 by adding support for multiple arguments to
:raw, essentially restoring 1.x functionality (while still allowing for embedded vectors as expressions, introduced in 2.x).
- Fix #478 by handling
-
2.4.1002 -- 2023-03-03
- Address #474 by adding dot-selection special syntax.
- Improve docstrings for PostgreSQL operators via PR #473 @holyjak.
- Address #471 by supporting interspersed SQL keywords in function calls.
- Fix #467 by allowing single keywords (symbols) as a short hand for a single-element sequence in more constructs via PR #470 @p-himik.
- Address #466 by treating
[:and]asTRUEand[:or]asFALSE. - Fix #465 to allow multiple columns in
:order-byspecial syntax via PR #468 @p-himik. - Fix #464 by adding an optional type argument to
:arrayvia PR #469 @p-himik. - Address #463 by explaining
:quoted nilvia PR #475 @nharsch. - Address #462 by adding a note in the documentation for set operations, clarifying precedence issues.
-
2.4.980 -- 2023-02-15
- Fix #461 -- a regression introduced in 2.4.979 -- by restricting unary operators to just
+,-, and~(bitwise negation).
- Fix #461 -- a regression introduced in 2.4.979 -- by restricting unary operators to just
-
2.4.979 -- 2023-02-11
-
2.4.972 -- 2023-02-02
- Address #456 by allowing
formatto handle expressions (like 1.x could) as well as statements. This should aid with migration from 1.x to 2.x.
- Address #456 by allowing
-
2.4.969 -- 2023-01-14
- Fix #454 by allowing
-to be variadic. - Address #452 by adding
:replace-intoto the core SQL supported, instead of just for the MySQL and SQLite dialects (so the latter is not needed yet). - Address #451 by adding a test for it, showing how
:nestproduces the desired result. - Address #447 by updating GitHub Actions and dependencies.
- Address #445 and #453 by adding key/constraint examples to
CREATE TABLEdocs.
- Fix #454 by allowing
-
2.4.962 -- 2022-12-17
- Fix
set-options!(only:checkingworked in 2.4.947). - Fix
:castformatting when quoting is enabled, via PR #443 duddlf23. This changes how type names containing-are formatted in a cast. SeecastSpecial Syntax for more details. - Fix #441 by adding
:replace-intoto in-flight clause order (as well as registering it for the:mysqldialect). - Fix #434 by special-casing
:'ARRAY. - Fix #433 by supporting additional
WITHsyntax, via PR #432, @MawiraIke. [Technically, this was in 2.4.947, but I kept the issue open while I wordsmithed the documentation] - Address #405 by adding
:numberedoption, which can also be set globally usingset-options!.
- Fix
-
2.4.947 -- 2022-11-05
- Fix #439 by rewriting how DDL options are processed; also fixes #386 and #437; Whilst this is intended to be purely a bug fix, it has the potential to be a breaking change -- hence the version jump to 2.4!
- Fix #438 by
supporting options on
TRUNCATE. - Address #435 by showing
CREATE TEMP TABLEetc. - Fix #431 --
WHERE falsediffered between the DSL and thewherehelper. - Address #430 by treating
:'as introducing a name that should be treated literally and not formatted as a SQL entity (which respects quoting, dot-splitting, etc); this effectively expands the "escape hatch" introduced via #352 in 2.2.868. Note that the function context behavior formats as a SQL entity, rather than the usual SQL "keyword", whereas this new context is a literal transcription rather than as a SQL entity! - Address #427 by adding
set-options!. - Address #415 by supporting multiple column names in
ADD COLUMN,ALTER COLUMN,DROP COLUMN, andMODIFY COLUMN.
-
2.3.928 -- 2022-09-04
- Address #425 by clarifying that
INTERVALas special syntax may be MySQL-specific and PostgreSQL uses difference syntax (becauseINTERVALis a data type there). - Address #423 by supporting
DEFAULTvalues andDEFAULTrows inVALUES. - Address #422 by auto-quoting unusual entity names when
:quoted(and:dialect) are not specified, making HoneySQL more secure by default. - Fix #421 by adding
:replace-intofor:mysqldialect. - Address #419 by adding
honey.sql.protocolsandInlineValuewith asqlizefunction. - Address #413 by flagging a lack of
WHEREclause forDELETE,DELETE FROM, andUPDATEwhen:checking :basic(or:checking :strict). - Fix #392 by adding support for
WITH/ (NOT)MATERIALIZED-- via PR #420 @robhanlon22.
- Address #425 by clarifying that
-
2.3.911 -- 2022-07-29
- Address #418 by documenting a potential "gotcha" with multi-column
INexpressions (a change from HoneySQL 1.x). - Fix #416 via PR #417 from @corasaurus-hex -- using the internal default state for the integrity assertion.
- Address #414 by providing an example of
ORDER BYwith aCASEexpression. - Address #412 by documenting options in a separate page and reorganizing the ToC structure.
- Address #409 by making docstring check for public helpers conditional.
- Fix #406 by adding
:alter-column(which producesMODIFY COLUMNwhen the MySQL dialect is selected) and deprecating:modify-column. - Address #401 by adding
register-dialect!andget-dialect, and also makingadd-clause-before,strop, andupper-casepublic so that new dialects are easier to construct.
- Address #418 by documenting a potential "gotcha" with multi-column
-
2.2.891 -- 2022-04-23
- Address #404 by documenting PostgreSQL's
ARRAYconstructor syntax and how to produce it. - Address parts of #403 by improving the documentation for
:arrayand also improving the exception that was thrown when it was misused. - Fix #402 by allowing for expressions in
:insert-intotable. - Address #400 by adding
:tableclause. - Address #399 by correcting multi-column
RETURNINGclauses in docs and tests. - Fix #398 by adding
honey.sql.pg-opsnamespace that registers PostgreSQL JSON and regex operators and provides symbolic names for "unwritable" operators (that contain@,#, or~). - Address #396 by throwing an exception if you try to cache a SQL statement that includes an
IN ()expression, using a named parameter for theINvalues. - Fix #394 by restoring HoneySQL 1.x's behavior when quoting.
- Fix #387 again.
- Update CI to reflect Clojure 1.11 release (master -> 1.11; new master is 1.12).
- Update
build-cljto v0.8.0.
- Address #404 by documenting PostgreSQL's
-
2.2.868 -- 2022-02-21
-
2.2.861 -- 2022-01-30
-
2.2.858 -- 2022-01-20
- Address #377 by adding
honey.sql/map=to convert a hash map into an equality condition (for aWHEREclause). - Address #351 by adding a
:cacheoption tohoney.sql/format(for Clojure only, not ClojureScript). - Address #281 by adding support for
SELECT * EXCEPT ..andSELECT * REPLACE ..andARRAY<>andSTRUCT<>column types -- see SQL Clause Reference - SELECT and SQL Clause Reference - DDL respectively for more details. - Update
build-cljto v0.6.7.
- Address #377 by adding
-
2.2.840 -- 2021-12-23
- Fix #375 for
:neststatement. - Fix #374 by removing aliasing of
:is/:is-not-- this changes the behavior of[:is-not :col true/false]to be correct and includeNULLvalues. Using:is/:is-notwith values that are not Boolean and notnilwill produce invalid SQL. - Update test dependencies.
- Update
build-cljto v0.6.5.
- Fix #375 for
-
2.1.833 -- 2021-12-03
- Fix #372 by merging
:select-distinct-ondifferently. - Add empty column list check for
SELECTand several other clauses, when:checking :basic(or:strict) is provided. - Update
build-cljto v0.6.0.
- Fix #372 by merging
-
2.1.829 -- 2021-11-27
- Fix #371 by treating the operand of
NOTas a nested expression (so it is parenthesized unless it is a simple value). - Fix #370 by always parenthesizing the operand of
:nest. - Address #369 by adding a big clarifying docstring to the
honey.sql.helpersnamespace pointing out that all helper functions are variadic, they are all[& args], some have:arglistsmetadata to provide a more specific usage hint but those all omit the optional first argument (the DSL hash map). - Fix #354 by supporting
DROP COLUMN IF EXISTS/ADD COLUMN IF NOT EXISTS. - Update
build-cljto v0.5.5.
- Fix #371 by treating the operand of
-
2.1.818 -- 2021-10-04
- Fix #367 by supporting parameters in subexpressions around
IS NULL/IS NOT NULLtests. - Address #366 by introducing
:values-default-columnsoption to control whether missing columns are treated asNULLorDEFAULTin:valuesclauses with sequences of hash maps. - Fix #365 -- a regression from 1.x -- where subclauses for
UNION,EXCEPT, etc were incorrectly parenthesized. - Update
build-cljto v0.5.0.
- Fix #367 by supporting parameters in subexpressions around
-
2.0.813 -- 2021-09-25
- Address #364 by recommending how to handle PostgreSQL operators that contain
@. - Fix #363 and #362 by aligning more closely the semantics of
:inlinesyntax with the:inline trueoption. A side effect of this is that[:inline [:param :foo]]will now (correctly) inline the value of the parameter:foowhereas it previously producedPARAMS SOURCE. In addition, inlining has been extended to vector values, so[:inline ["a" "b" "c"]]will now produce('a', 'b', 'c')and[:inline [:lift ["a" "b" "c"]]]will now produce['a', 'b', 'c']which is what people seemed to expect (the behavior was previously unspecified). - Fix #353 by correcting handling of strings used as SQL entities (such as table names); this was a regression introduced by a recent enhancement to
:create-table. - Fix #349 by adding an optional
:quotedargument toset-dialect!. - Address #347 by adding example of adding a primary key to an existing table via
:add-index. - Support
ASaliasing inDELETE FROM. - Switch from
readmetotest-doc-blocksso all documentation is tested! - Clean up build/update deps.
- Address #364 by recommending how to handle PostgreSQL operators that contain
-
2.0.783 -- 2021-08-15 (a.k.a "2.0 Gold")
- Fixes #344 by no longer dropping the qualifier on columns in a
SETclause for the:mysqldialect only; the behavior is unchanged for all other dialects. - Fixes #340 by making the "hyphen to space" logic more general so operators containing
-should retain the hyphen without special cases. - Documentation improvements:
:fetch,:lift,:limit,:offset,:param,:select; also around JSON/PostgreSQL. - Link to the HoneySQL web app in both the README and Getting Started.
- Switch to
tools.buildfor running tests and JAR building etc.
- Fixes #344 by no longer dropping the qualifier on columns in a
-
2.0.0-rc5 (for testing; 2021-07-17)
- Fix #338 by producing
OFFSET n ROWS(orROWifnis 1) if:fetchis present or:sqlserverdialect is specified; and by producingFETCH NEXT n ROWS ONLY(orROWisnis 1; orFIRSTinstead ofNEXTif:offsetis not present). - Fix #337 by switching to
clojure.testeven for ClojureScript. - Address #332 by improving
:cross-joindocumentation. - Address #330 by improving exception when a non-entity is encountered where an entity is expected.
- Fix
fetchhelper (it previously returned an:offsetclause). - Fix bug in unrolling nested argument to
with-columnshelper.
- Fix #338 by producing
-
2.0.0-rc3 (for testing; 2021-06-16)
- Fix #328 by adding
:distinctas special syntax, affecting an expression. - Address #327 by changing "unknown clause" error to including mention of "nil values" (which are also illegal).
- Fix #327 by making single-argument helpers consistent with multi-argument helpers.
- Support PostgreSQL's
&&array operator. - Clarify how to
SELECTa function expression (in Getting Started). - Update
test-runner.
- Fix #328 by adding
-
2.0.0-rc2 (for testing; 2021-05-10)
- Fix #326 by allowing
ON/USINGto be optional and not dropping parameters on the floor. - Fix #325 by making the
%function call syntax respect:quoted trueand/or:dialectoptions, and also allowing for qualified column names. (PR from @lognush) - Add
:quoted-snake trueoption to force conversion from kebab-case to snake_case when:quoted trueor a:dialectis specified toformat. - Update
test-runner.
- Fix #326 by allowing
-
2.0.0-rc1 (for testing; 2021-05-06)
- Fix #324 so that
insert-intosupports merging into another statement in all cases. - Fix #323 by supporting more than one SQL entity in
:on-conflict. - Fix #321 by adding
:checkingmode. Currently only detects potential problems withINclauses.
- Fix #324 so that
-
2.0.0-beta2 (for testing; 2021-04-13)
- The documentation continues to be expanded and clarified in response to feedback!
- Fix #322 by rewriting/simplifying
WHERE/HAVINGmerge logic. Important bug fix! - Fix #310 by adding support for
FILTER,WITHIN GROUP, andORDER BY(as an expression), from nilenso/honeysql-postgres 0.4.112. These are Special Syntax and there are also helpers forfilterandwithin-group-- so be careful about referring in all ofhoney.sql.helperssince it will now shadowclojure.core/filter(it already shadowsfor,group-by,into,partition-by,set, andupdate). - Fix #308 by supporting join clauses in
join-by(and correcting the helper docstring).
-
2.0.0-beta1 (for testing; 2021-04-09)
- The merging behavior of
where/havingis broken in Beta 1! - Since Alpha 3, more documentation has been written and existing documentation clarified (addressing #300, #309, #313, #314).
- Fix #319 by ensuring
register-clause!is idempotent. - Fix #317 by dropping qualifiers in
:setclauses (just like we do with:insertcolumns). Note that you can still use explicit dotted names if you want table qualification. - Fix #316 by disallowing entity names containing
;(to avoid SQL injection risks). - Fix #312 by adding
:rawas a clause. There is no helper function equivalent (because it would be ambiguous whether you meant a function form --[:raw ..]-- or a clause form --{:raw ..}; and for the same reason, there is nonesthelper function since that also works as a clause and as a function/special syntax).
- The merging behavior of
-
2.0.0-alpha3 (for early testing; 2021-03-13)
- Change coordinates to
com.github.seancorfield/honeysql(although new versions will continue to be deployed toseancorfield/honeysqlfor a while -- see the Clojars Verified Group Names policy). - Support much richer range of syntax on
CREATE/DROPstatements in general, including columns,TABLESPACE,CASCADE,WITH [NO] DATA, etc. - Fix #306 by supporting
CREATE TABLE .. AS ... - Fix #305 by supporting more complex join clauses.
- Fix #303 by supporting MySQL's
ON DUPLICATE KEY UPDATE. - Fix #301 by adding support for
CREATE/DROP/REFRESHonMATERIALIZED VIEW. - Add tests to confirm #299 does not affect 2.x.
- Fix #297 by adding both
SELECT .. INTO ..andSELECT .. BULK COLLECT INTO ... - Fix #295 by adding docstrings to all helper functions (and adding an assert to ensure it stays that way as more are added in future).
- Confirm the whole of the nilenso/honeysql-postgres is implemented out-of-the-box (#293, up to 0.3.104 -- see also #310 which brought parity up to 0.4.112).
- Fix #292 by adding support for
SELECT TOPandOFFSET/FETCH. - Fix #284 by adding support for
LATERAL(as special syntax, with a helper). - Reconcile
wherebehavior with recent 1.x changes (porting #283 to 2.x). - Fix #280 by adding
:escapeas special syntax for regular expression patterns. - Fix #277 by adding
:join-by/join-byso that you can have multipleJOIN's in a specific order.
- Change coordinates to
-
2.0.0-alpha2 (for early testing)
- Since Alpha 1, a lot more documentation has been written and docstrings have been added to most functions in
honey.sql.helpers. - Numerous small improvements have been made to clauses and helpers around insert/upsert.
- Since Alpha 1, a lot more documentation has been written and docstrings have been added to most functions in
-
2.0.0-alpha1 (for early testing)
- This is a complete rewrite/simplification of HoneySQL that provides just two namespaces:
honey.sql-- this is the primary API via theformatfunction as well as the various extension points.honey.sql.helpers-- provides a helper function for every piece of the DSL that is supported out-of-the-box.
- The coordinates for HoneySQL 2.x are
com.github.seancorfield/honeysqlso it can be added to a project that already uses HoneySQL 1.x without any conflicts, making it easier to migrate piecemeal from 1.x to 2.x.
- This is a complete rewrite/simplification of HoneySQL that provides just two namespaces:
HoneySQL pre-2.x Changes
-
1.0.461 -- 2021-02-22
- Fix #299 potential SQL injection vulnerability.
- Fix/Improve
merge-where(andmerge-having) behavior. #282 via #283 (@camsaul)
-
1.0.444 -- 2020-05-29
- Fix #259 so column names are always unqualified in inserts. (@jrdoane)
- Fix #257 by adding support for
cross-join/merge-cross-join/:cross-join. (@dcj) - Switch dev/test pipeline to use CLI/
deps.edninstead of Leiningen. Also add CI vi both CircleCI and GitHub Actions. - Switch to MAJOR.MINOR.COMMITS versioning.
- Remove macrovich dependency as this is no longer needed with modern ClojureScript.
- Add mention of
next.jdbceverywhereclojure.java.jdbcwas mentioned.
-
0.9.10 -- 2020-03-06
- Fix #254 #255 by adding support for
except. (@ted-coakley-otm) - Fix #253 properly by supporting
falseas well. (@ted-coakley-otm) - Add cljs testing to
deps.edn, also multi-version clj testing and newreadmetesting.
- Fix #254 #255 by adding support for
-
0.9.9 -- 2020-03-02
- Fix #253 by supporting non-sequential join expressions.
-
0.9.8 -- 2019-09-07
- Fix #249 by adding
honeysql.format/*namespace-as-table?*and:namespace-as-table?option toformat. (@seancorfield)
- Fix #249 by adding
-
0.9.7 -- 2019-09-07
- Fix #248 by treating alias as "not a subquery" when generating SQL for it. (@seancorfield)
- Fix #247 by reverting #132 / #131 so the default behavior is friendlier for namespace-qualified keywords used for table and column names, but adds
honeysql.format/*allow-namespaced-names?*to restore the previous behavior. A:allow-namespaced-names?option has been adding toformatto set this more easily. (@seancorfield) - Fix #235 by adding
set0(:set0) andset1(:set1) variants ofsset(:set) to support different placements ofSET(beforeFROMor afterJOINrespectively) that different databases require. See also #200. (@seancorfield) - Fix #162 by adding
composite/:compositeconstructor for values. (@seancorfield) - Fix #139 by checking arguments to
columns/merge-columnsand throwing an exception if a single collection is supplied (instead of varargs). (@seancorfield) - Fix #128 by adding
truncatesupport. (@seancorfield) - Fix #99 by adding a note to the first use of
selectin the README that column names can be keywords or symbols but not strings. (@seancorfield)
-
0.9.6 -- 2019-09-24
- Filter
nilconditions out ofwhere/merge-where. Fix #246. (@seancorfield) - Fix reflection warning introduced in 0.9.5 (via PR #237).
- Filter
-
0.9.5 -- 2019-09-07
- Support JDK11 (update Midje). PR #238. (@camsaul)
- Support Turkish user.language. PR #237. (@camsaul)
format-predicatenow acceptsparameterizeras a named argument (default:jdbc) to matchformat. PR #234. (@glittershark)
-
0.9.4 -- 2018-10-01
#sql/inline nilshould produceNULL. Fix #221. (@seancorfield)#sql/inline :kwshould produce"kw". Fix #224 via PR #225. (@vincent-dm) Note: this introduces a new protocol,Inlinable, which controls inline value rendering, and changes the behavior of#sql/inline :foo/barto produce just"bar"(where it was probably invalid SQL before).- Alias expressions
[:col :alias]are now checked to have exactly two elements. Fix #226. (@seancorfield) - Allow
whereandmerge-whereto be given no predicates. Fix #228 and PR #230. (@seancorfield, @arichiardi) asalias is no longer split during quoting. Fix #221 and PR #231. (@gws)
Earlier releases
Not all of these releases were tagged on GitHub and none of them have release notes on GitHub. Releases prior to 0.5.0 were not documented (although some were tagged on GitHub).
-
0.9.3
- Support parameters in
#sql/raw. Fix #219. (@seancorfield) - Add examples of table/column aliases to the README. Fix #215. (@seancorfield)
- Refactor parameterizer to use multimethods. PR #214. (@xlevus)
- Add examples of
rawandinlineto the README. Fix #213. (@seancorfield) - Add
register-parameterizerfor custom parameterizers. PR #209. (@juvenn) - Change
setpriority to afterjoin. Fix #200. (@michaelblume) - Switch dependency version checker to deps.co. PR #197. (@danielcompton)
- Support
join ... using( ... ). Fix #188, PR #201. (@vincent-dm) - Add multi-version testing for Clojure 1.7, 1.8, 1.9, 1.10 (master) (@seancorfield)
- Bring all dependencies up-to-date. (@seancorfield)
- Add
run-tests.shto make it easier to run the same tests manually that run on Travis-CI. (@seancorfield) - Add
deps.ednto supportclj/tools.deps.alpha. (@seancorfield) - Expose
#sql/inlinedata reader. (@seancorfield)
- Support parameters in
-
0.9.2
- Remove
nil:andarguments for where. Fix #203. (@michaelblume) - Fix nested
selectformatting. Fix #198. (@visibletrap) - Limit value context to sequences in value positions. (@xiongtx)
- Avoid wrapping QUERY with parens while formatting
INSERT INTO ... QUERY. (@emidln) - Allow for custom name-transform-fn. Fix #193. (@madvas)
- Add :intersect to default-clause-priorities. (@kenfehling)
- Add
:parameterizer:nonefor skippingnext.jdbcorclojure.java.jdbcparameter generation. (@arichiardi) - Add ClojureScript self-host support. (@arichiardi)
- Remove
-
0.9.1
- Add helper to inline values/prevent parameterization (@michaelblume)
-
0.9.0 --
- BREAKING CHANGE: Some tuples used as values no longer work. See #168.
- Reprioritize WITH wrt UNION and UNION ALL (@emidln)
- Helpers for
:withand:with-recursiveclauses (@enaeher) - Ensure sequences act as function invocations when in value position (@joodie)
- Correct generated arglist for helpers defined with defhelper (@michaelblume)
- Don't depend on map iteration order, fix bug with multiple map types (@tomconnors)
- Don't throw away namespace portion of keywords (@jrdoane)
- Update CLJS dependencies (@michaelblume)
- Add helpers for :with and :with-recursive clauses (@enaher)
-
0.8.2
- Don't parenthesize the subclauses of a UNION, UNION ALL, or INTERSECT clause. (@rnewman)
-
0.8.1
- Add priority for union/union-all (@seancorfield)
-
0.8.0
- Get arglists right for generated helpers (@camsaul, @michaelblume)
- Allow HoneySQL to be used from ClojureScript (@rnewman, @michaelblume)
- BREAKING CHANGE: HoneySQL now requires Clojure 1.7.0 or above.
-
0.7.0
- Parameterize numbers, properly handle NaN, Infinity, -Infinity (@akhudek)
- Fix lock example in README (@michaelblume)
- Allow joins without a predicate (@stuarth)
- Escape quotes in quoted identifiers (@csummers)
- Add support for INTERSECT (@jakemcc)
- Upgrade Clojure dependency (@michaelblume)
-
0.6.3
- Fix bug when SqlCall/SqlRaw object is first argument to another helper (@MichaelBlume)
- Add support for :intersect clause (@jakemcc)
-
0.6.2
- Support column names in :with clauses (@emidln)
- Support preserving dashes in quoted names (@jrdoane)
- Document correct use of the :union clause (@dball)
- Tests for :union and :union-all (@dball)
- Add fn-handler for CASE statement (@loganlinn)
- Build/test with Clojure 1.7 (@michaelblume)
- Refactors for clarity (@michaelblume)
-
0.6.1
- Define parameterizable protocol on nil (@dball)
-
0.6.0
- Convert seq param values to literal sql param lists (@dball)
- Apply seq to sets when converting to sql (@dball)
-
0.5.3
- Support exists syntax (@cddr)
- Support locking selects (@dball)
- Add sql array type and reader literal (@loganmhb)
- Allow user to specify where in sort order NULLs fall (@mishok13)
-
0.5.2
- Add value type to inhibit interpreting clojure sequences as subqueries (@MichaelParam)
- Improve documentation (@hlship)
- Add type hints to avoid reflection (@MichaelBlume)
- Allow database-specific query parameterization (@icambron, @MichaelBlume)
-
0.5.1
- Add :url to project.clj (@MichaelBlume)
-
0.5.0
- Support basic common table expressions (:with, :with-recursive) (@akhudek)
- Make clause order extensible (@MichaelBlume)
- Support extended INSERT INTO...SELECT syntax (@ddellacosta)
- Update clojure version to 1.6.0 (@MichaelBlume)
- Implement ToSql on Object, vastly improving performance (@MichaelBlume)
- Support CAST(foo AS type) (@senior)
- Support postgres-native parameters (@icambron)
- Support :full-join (@justindell)
- Expose :arglist metadata in defhelper (@hlship)
- Improvements to the documentation, especially showing some recently added features, such as inserts and updates.