Commit graph

236 commits

Author SHA1 Message Date
Sean Corfield
ab0a3eebae the first part of #412 2022-06-27 21:17:54 -07:00
Sean Corfield
5fe73c75bc Support custom dialects fixes #401 (add docs/tests) 2022-05-01 17:34:31 -07:00
Sean Corfield
796c734cba prep for 2.2.891 release 2022-04-23 16:11:52 -07:00
Sean Corfield
270b9439c8 attempting to cache SQL that contains IN () will throw fixes #396 2022-04-23 15:54:24 -07:00
Sean Corfield
03275b1035 add caveat for caching about #396 2022-04-23 15:45:35 -07:00
Sean Corfield
fdc70c67a9 fix typo in example 2022-04-23 15:45:10 -07:00
Sean Corfield
e45ea8586e Add PostgreSQL JSON / regex operators fixes #398 2022-04-23 15:40:47 -07:00
Sean Corfield
13a8aa11b2 skip the example that throws 2022-04-23 14:11:19 -07:00
Sean Corfield
7f8b7a79b1 addresses #403: improve error message; improve docs 2022-04-23 13:40:34 -07:00
Sean Corfield
9e72587bf3 Document special array constructor for PostgreSQL fixes #404 2022-04-23 13:21:07 -07:00
Sean Corfield
314f497417 fix #400 by adding :table clause 2022-03-26 16:58:28 -07:00
Sean Corfield
ab7c235329 fix #399 by correcting docs and tests 2022-03-26 13:45:43 -07:00
Sean Corfield
beedc35a22 prep for 2.2.868 2022-02-21 20:28:07 -08:00
Sean Corfield
1d22086fce fix #381 by adding generic helpers; prep for 2.2.861 2022-01-30 22:31:37 -08:00
Sean Corfield
8a2f447676 Fix #382 by adding :case-expr syntax 2022-01-29 17:19:17 -08:00
Sean Corfield
30209b6cc7 prep for 2.2.858 2022-01-20 13:09:47 -08:00
Sean Corfield
e3de2a621d document :cache option
Also try to clear up confusion about function syntax while I'm adding
examples!
2022-01-20 13:02:17 -08:00
Sean Corfield
2670abc75f fix #377 by adopting @corasaurus-hex function as map= 2022-01-07 23:16:56 -08:00
Sean Corfield
99ce051a9d add array/struct support 2022-01-07 12:53:30 -08:00
Sean Corfield
a653f9b157 address #281 add select * except / replace for BigQuery 2022-01-06 23:02:20 -08:00
Sean Corfield
6e4e1f6928 prep for 2.2.840 2021-12-23 13:37:20 -08:00
Sean Corfield
8979e938f3 fixes #374 2021-12-23 13:32:47 -08:00
Sean Corfield
b30aa0f3f9 fix #375 2021-12-21 22:54:02 -08:00
Sean Corfield
8118f5448e prep for 2.1.833 2021-12-03 13:23:51 -08:00
Sean Corfield
d607f01dd5 prep for 2.1.832 2021-12-03 13:19:27 -08:00
Sean Corfield
e0cafbd434 extend lint checks to several column lists 2021-12-03 13:06:34 -08:00
Sean Corfield
718b7f036f prep for 2.1.829 2021-11-27 16:02:44 -08:00
Sean Corfield
66fc3a68ee fix #354 2021-11-27 15:27:12 -08:00
Sean Corfield
be1df97b2b fix #371 2021-11-26 22:30:36 -08:00
Sean Corfield
9052626805 prep for 2.1.818; document :values-default-columns 2021-10-04 16:09:28 -07:00
Sean Corfield
6aee04e25c fixes #365 2021-10-03 22:18:12 -07:00
Sean Corfield
78cc769b98 prep for 2.0.813 2021-09-25 17:58:51 -07:00
Sean Corfield
feb0c9a6f8 fixes #347 2021-09-25 17:35:02 -07:00
Sean Corfield
92e0a04a84 fixes #353 fixes #349 2021-09-25 17:27:04 -07:00
Sean Corfield
e44a30a7fd fixes #364 2021-09-25 16:32:00 -07:00
lread
cccd3e96fd Doc block testing now understands refer-clojure
Test-doc-blocks added support for this feature
2021-08-30 17:40:25 -04:00
lread
35c5aee584 Test code blocks in docs with test-doc-blocks
Resolves #290

**Build**

New commands:
- `gen-doc-tests` - only regenerates tests if stale,
   use `clean` command to force regen
- `run-doc-tests` - calls gen-doc-tests then runs tests,
  accepts the same parameters as run-tests.
  Can specify `:platform`
    - `:cljs` - run tests under ClojureScript
    - otherwise Clojure where we can specify one of: `:1.9`
    `:1.10` `:master`

I'm not sure if my use of the `:platform` parameter jives with
your `:aliases` parameter used for `run-tests`.
Can adjust if you like.

Example usages:
```shell
clojure -T:build gen-doc-tests

clojure -T:build run-doc-tests :platform :cljs

clojure -T:build run-doc-tests

clojure -T:build run-doc-tests :platform :1.10
```

The `ci` command has been updated to generate and run doc tests for same
platforms as unit tests.

**Articles**

In addition to `README.md`, now testing doc blocks in all articles
under `doc` dir excepting `doc/operator-reference.md` which does not
have any runnable code blocks.

**Skipped**

Any code block that is intentionally not runnable has been marked to be
skipped via: `<!-- :test-doc-blocks/skip -->`.

**Consistency**

I noticed that some code blocks use REPL syntax:
```Clojure
user=> (+ 1 2 3)
6
```
and others use editor syntax:
```Clojure
(+ 1 2 3)
;;=> 6
```
some places also omit the comment for editor style:
```Clojure
(+ 1 2 3)
=> 6
```
All of this is just fine with test-doc-blocks.
I left the inconsistency as is, but can make a pass for consistency upon
request.

**HoneySQL state**

I noticed a code block that set the sql dialect was affecting other
tests. I simply restored the dialect to the default at the end of the
code block.

**Un-tweaked output**

Some code blocks had string output hand-tweaked for readability.
These have been adjusted to instead use `sql/format`'s `:pretty` option.
In some cases the output is not as readable as the hand-tweaked version.
I humbly suggest that perhaps `:pretty` output could perhaps be
improved (instead of having test-doc-blocks somehow adapt).

**Corrections**

There were very few code blocks that required fixing due to incorrect
output/code.  Please review the diffs carefully to make sure all is as
expected.

**refer-clojure :excludes**

Not currently supported for test-doc-blocks, not a real issue for
Clojure, we'll see warnings under Clojure, but that's probably ok.

But I might actually need it for ClojureScript.
I was finding that `for` did not get overridden by our helper
`:refer` in CloureScript.

Will add proper support to test-doc-blocks but in the short-term,
will use `h/for`.

**ns requires adjustments**

Any specific case of `(ns my-ns (require [my-require :as a]))` is now
the REPL friendly `(require '[my-require :as a])`

Any missing required `requires` were added.

The HoneySQL docs seem to encourage the use of referred vars for
helpers. Although this has the con of overlaps with Clojure core vars,
it is also convenient for Clojure when using `:refer :all`.

**ClojureScript :refer**

ClojureScript does not support `:refer :all` and each var must be
specified in place of `:all`.

I have adjusted examples accordingly to work with both Clojure and
ClojureScript.
2021-08-27 18:39:07 -04:00
Sean Corfield
ee65201cfc prep for 2.0 Gold (2.0.783) 2021-08-15 11:27:09 -07:00
Sean Corfield
249ab639ec Add links to HoneySQL web app 2021-08-06 11:35:53 -07:00
Sean Corfield
4480c9c1c7 Merge branch 'develop' of github.com:seancorfield/honeysql into develop 2021-07-18 16:36:15 -07:00
Sean Corfield
904af73505 Fixes #339 by calling out param/lift for JSON usage 2021-07-18 16:36:11 -07:00
Sean Corfield
3680a1beae Address #332 by improving select docs 2021-07-17 18:59:26 -07:00
Sean Corfield
13044d7394 fix/improve limit, offset, fetch docs 2021-07-17 18:49:11 -07:00
Sean Corfield
01c3a555ba prep for RC 5(!) 2021-07-17 18:00:02 -07:00
Sean Corfield
1836c7bcf1 Address #332 by improving :cross-join docs 2021-07-17 14:49:18 -07:00
Sean Corfield
679a0309db prep for 2.0.0-rc4 2021-07-17 14:25:55 -07:00
Alan Chan
fa5c45e985 Remove duplicate example of insert clause 2021-07-10 14:10:23 +08:00
Sean Corfield
a2ee638b3b prep for 2.0.0-rc3 2021-06-16 23:01:33 -07:00
Sean Corfield
a51cfe5a2e Fixes #328 by adding :distinct special syntax 2021-06-12 18:15:59 -07:00
Sean Corfield
f508196ba3 Address #329 2021-06-12 18:15:41 -07:00
Sean Corfield
6b284bfc77 Note NULLS FIRST/LAST in ORDER BY 2021-05-28 18:24:54 -07:00
Sean Corfield
77191e26f6 Explain SELECT function expression 2021-05-19 18:12:50 -07:00
Sean Corfield
81fda8592d Prep for 2.0.0 RC 2 2021-05-10 22:51:41 -07:00
Sean Corfield
9e0b31bbd9 Fixes #325 Fixes #326 adds tests/docs 2021-05-10 22:44:57 -07:00
Sean Corfield
d73560b7e3 Add :quoted-snake option 2021-05-08 21:01:28 -07:00
Sean Corfield
11fcfd5257 Prep for 2.0.0-rc1 2021-05-06 22:12:46 -07:00
Sean Corfield
20cba15da2 Fixes #321 by adding :checking option
Initial linting is only for IN () and IN (NULL)
2021-04-22 22:13:32 -07:00
Sean Corfield
f606dc6044 Fixes #323 by allowing multiple column names 2021-04-22 19:16:30 -07:00
Sean Corfield
e227e1b9ab Prep for 2.0.0-beta2 2021-04-13 12:55:40 -07:00
Sean Corfield
e6a5bdb001 Fixes #308 by adding support for clauses
This also corrects the docstring for the join-by helper.
2021-04-11 04:18:14 -07:00
Sean Corfield
bb9d196e3e Document nilenso catch up to 0.4.112 2021-04-11 03:14:23 -07:00
Sean Corfield
50fd829752 Addresses #310 by adding filter, order-by, within-group syntax 2021-04-11 14:32:48 -07:00
Sean Corfield
bbc0ac8500 Documentation updates 2021-04-11 11:39:06 -07:00
Sean Corfield
862a2496c6 Consistent use of 1.x / 2.x 2021-04-11 11:09:47 -07:00
Sean Corfield
f393a61010 Remove honey.specs (for now) #146 2021-04-10 03:58:29 -07:00
Sean Corfield
f231151243 Fix column descriptors links 2021-04-10 00:17:42 -07:00
Sean Corfield
35c6fc58a5 Prep for 2.0.0 Beta 1 2021-04-09 23:51:31 -07:00
Sean Corfield
88282ee258 Fixes #316 by adding check on entity characters
Also record that documentation addresses #300, #309, #313, and #314.
2021-04-09 23:41:59 -07:00
Sean Corfield
cf7e36a131 Addresses #313 by documenting entity formatting in detail 2021-04-09 23:07:19 -07:00
Sean Corfield
1548433c02 WIP on entities 2021-04-09 18:39:01 -07:00
Sean Corfield
0411364ee5 Addresses #314 by documenting composite 2021-04-09 18:06:57 -07:00
Sean Corfield
c2e8bb9193 Finish off the PostgreSQL comparison docs 2021-04-09 17:48:13 -07:00
Sean Corfield
2da32c70f1 Clause reference tweaks/reordering 2021-04-09 17:35:39 -07:00
Sean Corfield
8f7c990eed Complete special syntax docs 2021-04-09 17:23:39 -07:00
Sean Corfield
2fe083f8e6 Support named arguments in format again
With the advent of Clojure 1.11 and the ability to call functions that
accept named arguments using a hash map, I have restored the named
argument version of `format` (in addition to the hash map version),
and if you are using Clojure 1.11 you can mix'n'match styles.
2021-04-09 17:04:48 -07:00
Sean Corfield
106b19bcf6 Add clause-order to see current clause order
This should help when folks are figuing out `register-clause!` calls.
2021-04-09 16:31:16 -07:00
Sean Corfield
b321df25d9 Add note about SQL Server TOP 2021-04-09 12:50:21 -07:00
Sean Corfield
cfb001e2f5 Complete the clause documentation! 2021-04-09 12:43:09 -07:00
Sean Corfield
dbecb152a1 Documentation updates and clarifications
This adds placeholders for reference documentation.
2021-04-08 23:06:07 -07:00
Sean Corfield
fd84864279 Fixes #161 by adding :raw clause support 2021-03-15 14:48:28 -07:00
Sean Corfield
d76b2d82b1 Prep for 2.0 Alpha 3 2021-03-13 15:55:31 -08:00
Sean Corfield
16d04a1dfd Fixes #297 by adding into/bulk-collect-into 2021-03-13 13:42:08 -08:00
Sean Corfield
cff1e5b43c Fixes #284 by adding lateral expression syntax 2021-03-13 13:13:35 -08:00
Sean Corfield
82ee465820 Fixes #292 by supporting offset/fetch 2021-03-13 12:36:25 -08:00
Sean Corfield
6b070df52c Finish off TOP implementation #292 2021-03-13 12:10:42 -08:00
Sean Corfield
dc6a3662f0 Fixes #303 by adding ON DUPLICATE KEY UPDATE 2021-03-12 16:13:52 -08:00
Sean Corfield
d35d9141bc Fixes #280 by adding [:escape pattern chars] 2021-03-12 15:39:54 -08:00
Sean Corfield
ddebda9481 Fixes #301 Fixes #306 by expanding drop/create syntax 2021-03-12 11:43:21 -08:00
Sean Corfield
445fb08e2f Initial work to support #301 2021-03-11 20:07:59 -08:00
Sean Corfield
e70985e93b Fixes #277 by adding join-by 2021-03-07 19:21:13 -08:00
Sean Corfield
d789c00f54 Reflect latest 1.x version 2021-03-07 09:45:08 -08:00
Sean Corfield
41522c89a1 Clarify 1.9+ Clojure support 2021-03-07 09:43:03 -08:00
Sean Corfield
b0782b93dd Prep for 2.0.0-alpha2 2021-02-16 11:43:18 -08:00
Sean Corfield
df60954495 Document DDL support 2021-02-15 21:20:20 -08:00
Sean Corfield
28a4074e12 Add flexibility for on conflict / on constraint 2021-02-15 20:43:53 -08:00
Sean Corfield
2f424e0258 Add a big chunk of Postgres/nilenso docs 2021-02-15 17:57:07 -08:00
Sean Corfield
c0dfdad19b Add modifiers to differences 2021-02-15 16:37:00 -08:00
Sean Corfield
9ec447109f Oracle dialect suppresses AS 2021-02-14 17:54:00 -08:00
Sean Corfield
63add4df3b Clean up differences code 2021-02-14 14:21:54 -08:00
Sean Corfield
2af7d0b690 Document :exists difference 2021-02-14 14:17:31 -08:00
Sean Corfield
26741450e6 Note relation between :lift and honeysql.format/value 2021-02-14 14:00:28 -08:00
Sean Corfield
78fe59d98c Fix one more link! 2021-02-14 11:04:39 -08:00
Sean Corfield
66d9f9dacb Fix some version-related links 2021-02-14 10:45:49 -08:00
Sean Corfield
0029402ae7 Fix typo in cljdoc.edn 2021-02-14 10:36:37 -08:00
Sean Corfield
41b1ce0eb8 Fix some links 2021-02-13 22:20:18 -08:00
Sean Corfield
fea5c74260 Set up for 2.0 Alpha 1 2021-02-13 22:10:10 -08:00
Sean Corfield
22384b9daa Fix links 2021-02-13 21:40:32 -08:00
Sean Corfield
645ce897c5 Document % function shorthand 2021-02-13 21:17:25 -08:00
Sean Corfield
2d9ceb73a6 Expand documentation 2021-02-13 21:10:49 -08:00
Sean Corfield
e585ded37e Restore upsert helper for #293 2021-02-13 19:08:40 -08:00
Sean Corfield
267eef778a Some more documentation! 2021-02-13 17:30:16 -08:00
Sean Corfield
6355452102 Update docs for the PG extension stuff 2021-02-13 16:17:30 -08:00
Sean Corfield
4ce56997c9 Fix rename table 2021-02-13 12:24:21 -08:00
Sean Corfield
4b7ded4009 WIP nilenso test (fails) 2021-02-13 10:50:36 -08:00
Sean Corfield
41ed38ea38 Finish and document DDL 2021-02-12 21:50:22 -08:00
Sean Corfield
167d7cee0c Addresses #293 by adding alter table stuff
And documenting more of the DDL.
2021-02-12 17:08:37 -08:00
Sean Corfield
83d4ccba38 Addresses #293 start work on DDL support 2021-02-10 20:07:05 -08:00
Sean Corfield
e157aec976 Addresses #293 by adding over, partition-by, and window 2021-02-10 16:25:31 -08:00
Sean Corfield
5318c184e6 Addresses #293 by expanding insert-into behavior
This adds alias support into `:insert-into`.
It also adds some tests for the PostgreSQL-specific
stuff currently in nilenso's library.
2021-02-10 15:07:16 -08:00
Sean Corfield
0a83601c3c Fixes #298 by restoring multi-CTE capability
Reverts code changes that stripped the sequence support.
Updates the docs to clarify how sequence support works.
2021-02-10 12:04:53 -08:00
Sean Corfield
e02b5b5c82 Revert "Document with / CTE"
This reverts commit c00fbffe30.
2021-02-10 11:50:00 -08:00
Sean Corfield
2c9be16d97 Finish the clause docs 2021-02-08 12:48:42 -08:00
Sean Corfield
c8fe84cbb4 Document values 2021-02-07 08:41:11 -08:00
Sean Corfield
09745c7237 Document :using 2021-02-07 16:36:52 -08:00
Sean Corfield
d2a08c17ef More docs 2021-02-07 05:13:39 -08:00
Sean Corfield
c39f1b49ee More clause docs 2021-02-07 04:47:31 -08:00
Sean Corfield
bb16567d50 Document more clauses 2021-02-07 03:40:29 -08:00
Sean Corfield
c00fbffe30 Document with / CTE
Change the implementation to support just a pair instead of the legacy,
weird sequence of one pair.
2021-02-06 09:00:46 -08:00
Sean Corfield
1d2b8e8203 Document special syntax 2021-02-02 16:43:09 -08:00
Sean Corfield
ea0bfbabc1 Outline of docs for clauses, operators, and special syntax 2021-02-02 14:50:12 -08:00
Sean Corfield
80c137949e Initial Getting Started/Extending HoneySQL docs 2021-02-02 12:25:26 -08:00
Sean Corfield
68eb590527 Add note about nilenso-postgres 2021-02-01 16:45:18 -08:00
Sean Corfield
1b749c1599 Overhaul differences document 2021-02-01 16:24:19 -08:00
Sean Corfield
429761f106 Fixes #261 by re-implementing :raw 2021-01-30 12:35:51 -08:00
Sean Corfield
1ebbbc1772 Fix inline string behavior 2020-09-25 16:38:11 -07:00
Sean Corfield
11ef895c4a Clean up dialect support; start docs
Also move old namespaces to test-only tree for reference while I 
continue developing V2.
2020-09-24 19:07:32 -07:00