Commit graph

246 commits

Author SHA1 Message Date
Sean Corfield
686cbf7272 fix #497 by adding tests and documenting :alias 2023-08-26 12:31:38 -07:00
Sean Corfield
664e5e2644 add create or replace view for postgresql 2023-08-23 12:45:19 -07:00
Sean Corfield
ba336f2884 clarify :values clause behavior with columns
also add more examples to the RCF at the bottom of honey.sql.
2023-08-10 19:31:17 -07:00
Sean Corfield
c2088bff6c prep for 2.4.1045 2023-06-25 15:53:04 -07:00
Sean Corfield
290537c581 fix #494 by supporting expressions in on conflict 2023-06-20 12:11:00 -07:00
Sean Corfield
19e73a3ebd fix #493 by clarifying with values 2023-06-10 19:18:36 -07:00
Sean Corfield
445f66ae1e fix #489 2023-06-10 19:12:15 -07:00
Sean Corfield
6ce63cad2c prep for 2.4.1033 2023-05-22 16:02:59 -07:00
Sean Corfield
077fc3f23a prep for 2.4.1026 2023-04-15 15:35:15 -07:00
Sean Corfield
bc66ec5aee fix #485 by adding :with-ordinality operator 2023-04-15 11:37:20 -07:00
Sean Corfield
1710e07231 fix #486 by support ansi/postgresl interval 2023-04-13 22:46:37 -07:00
Sean Corfield
2efe05def2 fix #484 by adding TABLE to TRUNCAT 2023-04-10 14:09:28 -07:00
Sean Corfield
8cbb7f3834 address #483 by adding tests & docs for :join 2023-04-07 11:42:39 -07:00
Sean Corfield
025e445d5d prep for 2.4.1011 2023-03-23 20:55:12 -07:00
Sean Corfield
522849381d fix #448 by adding database-specific hints and tips
including sqlite :)
2023-03-23 20:49:34 -07:00
Sean Corfield
f5744d4f21 fix #480 by adding notes about DSL clause to/from helper mapping 2023-03-23 19:29:09 -07:00
Sean Corfield
7e67caaf0c fix #481 by adding more examples 2023-03-23 19:22:59 -07:00
Sean Corfield
ece9be3a4b prep for 2.4.1006 2023-03-17 15:38:08 -07:00
Sean Corfield
bfc8ad6821 prep for 2.4.1002 2023-03-03 15:57:05 -08:00
Sean Corfield
7e35cb31bf fix #462 by adding precedence caveat to docs 2023-03-03 15:52:52 -08:00
Sean Corfield
1d7237884d fix #471 by documenting SQL kws in fn call args 2023-03-03 15:42:04 -08:00
Sean Corfield
3c65999ef1 fix #474 by documenting dot-selection
and adding support for two levels of field/column selection
2023-03-03 15:26:22 -08:00
Nigel Harsch (Vallen)
4b5e4e862b refs #463 - document dialect + quoted = nil behavior 2023-03-03 09:37:20 -08:00
Eugene Pakhomov
0c7642a357 Add optional type argument to the :array special 2023-02-28 02:04:05 +02:00
Sean Corfield
de0adf56ef fixes #461; prep for 2.4.980 2023-02-15 22:10:45 -08:00
Sean Corfield
0a6f645d91 prep for 2.4.979 2023-02-11 13:39:18 -08:00
Sean Corfield
762252b660 fixes #459 by making all operators variadic
except for := and the various :<> variants

some operators only make sense in binary usage and will produce invalid
SQL if used in a non-binary manner
2023-02-11 13:35:55 -08:00
Sean Corfield
6324eca4fc fixes #459 by making all operators variadic
except for := and the various :<> variants

some operators only make sense in binary usage and will produce invalid
SQL if used in a non-binary manner
2023-02-11 13:34:39 -08:00
Cam Saul
982ebd18e1
Update differences-from-1-x.md 2023-02-08 11:09:14 -08:00
Cam Saul
e783362c6a Add section about ORDER BY ... NULLS LAST to 1.x differences dox 2023-02-08 18:56:23 +00:00
Sean Corfield
ca78c7eed4 prep for 2.4.972 2023-02-02 10:35:23 -08:00
Sean Corfield
22f259e897 prep for 2.4.969 2023-01-14 16:00:22 -08:00
Sean Corfield
6bdc262e7c close #452 - support :replace-into in all dialects 2023-01-14 15:27:42 -08:00
Sean Corfield
6b015400ed fix #445 #453 2023-01-14 14:58:13 -08:00
Sean Corfield
56823b8888 prep for 2.4.962 2022-12-17 16:18:19 -08:00
Sean Corfield
bf96f034c3 update docs; fix set-options! 2022-12-17 16:02:02 -08:00
Sean Corfield
6e5e1b100d fix #433 #432 by smithing the docs 2022-11-20 04:49:31 -08:00
Youngil Choi
a87fa0c9ab Improve type formatting logic in :cast function 2022-11-20 06:51:43 +09:00
Sean Corfield
fd64353f41 prep for 2.4.947 2022-11-05 17:24:15 -07:00
Sean Corfield
95e50a930e fixes #386 #437 #439 2022-11-05 17:15:32 -07:00
Sean Corfield
e8ea9283cc fix Support full TRUNCATE syntax (cascade, identity) #438 2022-11-04 23:40:30 -07:00
Sean Corfield
dda3aa017e Merge branch 'develop' of github.com:seancorfield/honeysql into develop 2022-10-01 00:31:25 -07:00
Sean Corfield
6c107b7cf0 fix #435 by documenting CREATE TEMP TABLE etc 2022-10-01 00:31:20 -07:00
Ike Mawira
73d36ab2b5 Update docs and tests for WITH clause 2022-09-23 16:54:30 +03:00
Sean Corfield
5d7a3faea5 address #415 by supporting multiple drop columns 2022-09-12 13:51:54 -07:00
Sean Corfield
fb601c90d9 fix #430 by clarifying the additional escape hatch semantics 2022-09-12 12:45:50 -07:00
Sean Corfield
a2571ef312 close #427 by documenting the new function 2022-09-11 19:43:13 -07:00
Sean Corfield
723b134e90 fix set-dialect! reset and document it 2022-09-11 15:09:12 -07:00
Sean Corfield
23be700b7e prep for 2.3.928 2022-09-03 21:39:37 -07:00
Sean Corfield
2f1d3ae870 fixes #421 replace into 2022-09-03 21:34:09 -07:00
Sean Corfield
d0e0badf2c add/update docs for #422 #423 2022-09-03 21:07:06 -07:00
Sean Corfield
737699c11a fix #425 by clarifying MySQL vs PostgreSQL 2022-09-01 22:23:33 -07:00
Sean Corfield
e204f3b45e add security notes about quoting
also consistently use SQL entity names instead of identifiers so the
documentation is consistent in terminology.
2022-08-23 17:18:00 -07:00
Sean Corfield
99e955f420 fix #419 by adding InlineValue protocol 2022-08-06 21:49:49 -07:00
Sean Corfield
e6654f7a22 check for empty where clauses fix #413 2022-08-06 21:11:08 -07:00
Sean Corfield
061edc42f7 prep for 2.3.911 2022-07-29 18:27:02 -07:00
Sean Corfield
f0ada59fff fix #406 2022-07-29 15:41:04 -07:00
Sean Corfield
5f54fab989 document Differences between IN queries between v1 and v2 #418 2022-07-28 19:56:52 -07:00
Sean Corfield
8e72cb8f2c fixes #414 2022-07-15 11:13:15 -07:00
Sean Corfield
3def127276 address #412 by completing options docs 2022-07-05 22:41:25 -07:00
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