Sean Corfield
0bb7740f69
Docstrings
2021-02-14 20:45:14 -08:00
Sean Corfield
f4137d3fc1
Enhance insert-into; document more helpers
2021-02-14 20:39:32 -08:00
Sean Corfield
05360d10d6
More helper docstrings
2021-02-14 18:28:35 -08:00
Sean Corfield
d5ab2a8d8c
More helper docstrings
2021-02-14 17:54:13 -08:00
Sean Corfield
f6a38e4024
More helper docstrings
2021-02-14 17:20:24 -08:00
Sean Corfield
ea4e120252
Add docstrings for DDL helpers
2021-02-14 16:52:35 -08:00
Sean Corfield
f84726a48b
Reformatting to prepare for docstring addition
2021-02-14 11:37:27 -08:00
Sean Corfield
e23502eba8
Add create/drop extension #293
2021-02-13 22:06:43 -08:00
Sean Corfield
38da6f567b
Fixes #294 by applying inline everywhere
2021-02-13 21:29:22 -08:00
Sean Corfield
e585ded37e
Restore upsert helper for #293
2021-02-13 19:08:40 -08:00
Sean Corfield
6355452102
Update docs for the PG extension stuff
2021-02-13 16:17:30 -08:00
Sean Corfield
f6975ef6bd
Fix select as, select distinct on
2021-02-13 15:58:56 -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
49d8365bfb
Addresses #293 partial with-columns implementation
2021-02-10 22:32:29 -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
9f579f492a
Allow symbols in for/lock clauses
2021-02-08 12:48:33 -08:00
Sean Corfield
88ec86fd18
Allow direction to default with expression
2021-02-07 04:47:08 -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
4cbeb170dd
Ensure no dependence on vector (vs sequence)
2021-02-01 16:45:35 -08:00
Sean Corfield
d7c7f15a6b
Final de-?-ing keyword arguments/options
2021-02-01 16:24:00 -08:00
Sean Corfield
53bcfd8bea
Move toward 2.0.0 Alpha 1
2021-02-01 14:49:17 -08:00
Sean Corfield
379d3d05c4
Drop ? from all keyword options
2021-02-01 13:10:57 -08:00
Sean Corfield
2ef9d4dad2
Docstring overhaul
2021-02-01 12:00:42 -08:00
Sean Corfield
7aab640e30
Fixes #291 by ensuring consistent values
...
For uneven vectors of values, pad with NULLs.
For uneven maps of values, use full set of keys across all of them.
2021-02-01 10:44:07 -08:00
Sean Corfield
0e2aae4a00
Fix :lift and test to use wrapper
2021-01-31 05:31:10 -08:00
Sean Corfield
c92656389b
Make params dynamic/implement in/not-in
2021-01-31 05:08:21 -08:00
Sean Corfield
429761f106
Fixes #261 by re-implementing :raw
2021-01-30 12:35:51 -08:00
Sean Corfield
67c6c3a2cf
Fixes #275 by dropping 1.7 & 1.8
2021-01-30 11:50:14 -08:00
Sean Corfield
8373c72f45
Fixes #286 by supporting WAIT, SKIP LOCKED
...
NOWAIT was already supported.
2021-01-30 11:43:48 -08:00
Sean Corfield
d2968bbfcc
Fixes #289 by implementing USING
2021-01-30 11:19:12 -08:00
Sean Corfield
d5b11e2da6
Implement JOIN USING
2021-01-30 11:00:34 -08:00
Sean Corfield
07eb66759a
Restore cljs compatibility
2021-01-30 17:27:00 -08:00
Sean Corfield
87eec786e1
It's 2021
2021-01-29 16:11:52 -08:00
Sean Corfield
273732089b
Improve :inline/:raw
...
Note: these are still in flux!
2020-10-14 11:50:32 -07:00
Sean Corfield
b762a514b6
Addresses #280 by adding similar to / not similar to
2020-10-14 11:00:39 -07:00
Sean Corfield
4dcc44d878
Fix - as operator
...
Not a great workaround. May rethink depending on what other operators
get added containing `-`.
2020-10-14 11:00:20 -07:00
Sean Corfield
8025d3520d
Bug fixes for JOINs
2020-10-12 22:54:59 -07:00
Sean Corfield
b547a94003
Restore - -> _ translation from 1.0
2020-10-12 22:54:46 -07:00
Sean Corfield
f14b73e592
Start merging old core tests (for helpers)
2020-10-12 18:50:07 -07:00
Sean Corfield
0206eabc1e
Empty SQL vector support
...
Drop clauses that generate no SQL
2020-10-12 18:38:35 -07:00
Sean Corfield
eff3b03a81
Support case/when/then/else
2020-10-12 18:38:05 -07:00
Sean Corfield
d1e4e196d0
Support empty conditions
...
Which remove the clause
2020-10-12 18:37:48 -07:00
Sean Corfield
febcf385ee
Yet another where helper fix
...
Support nil conditions
2020-10-12 18:37:28 -07:00
Sean Corfield
96260901c2
All v1 core clauses are implemented now!
2020-10-12 14:53:52 -07:00
Sean Corfield
796f11c3f4
Fix composite by turning it into special syntax
2020-10-12 11:42:47 -07:00
Sean Corfield
ccd5447a09
Format sequential values as full SQL expressions
2020-10-12 11:33:18 -07:00
Sean Corfield
2decf35072
Fix most of the README formatting
2020-10-09 23:59:43 -07:00
Sean Corfield
9da83b5e1b
Fix where merging; fix single-arg helpers
2020-10-09 23:59:30 -07:00
Sean Corfield
d04d9f600a
Fix VALUES with multiple hash maps
2020-10-09 23:58:55 -07:00
Sean Corfield
15ace00e49
Fix string alias (should quote)
2020-10-09 23:58:38 -07:00
Sean Corfield
98b18bbb6e
Fix where/having helpers; add select-distinct
2020-10-09 23:05:05 -07:00
Sean Corfield
a83998d354
Documented extension mechanism; updated README
...
Helpers are the next big piece of work.
2020-10-09 22:31:55 -07:00
Sean Corfield
97a3782112
Support :inline option
...
This is similar to `:parameterizer :none` (but better).
2020-10-09 21:52:18 -07:00
Sean Corfield
0c7ce43381
Address #279 by treating UNION expressions as nested
2020-10-09 21:30:45 -07:00
Sean Corfield
04724df814
Implement :lift special syntax
2020-10-02 13:43:44 -07:00
Sean Corfield
6632335384
Add nesting support in expressions and the DSL
2020-10-02 13:24:44 -07:00
Sean Corfield
9f8d1a8564
Implement :?foo [:param :foo] and primitive [:raw "sql"]
2020-10-01 23:30:18 -07:00
Sean Corfield
ddef4068ba
Ensure DSL elements can be symbols (as well as keywords)
2020-09-30 13:00:09 -07:00
Sean Corfield
a789d4a4ff
Support registration of new infix operators and new function/syntax
2020-09-29 14:40:03 -07:00
Sean Corfield
b94f169af3
Normalize symbol/keyword logic
...
We will allow symbols anywhere that we previously allowed keywords.
2020-09-29 14:20:34 -07:00
Sean Corfield
8b2f0ef292
Add locking select support via for/lock
2020-09-28 20:45:43 -07:00
Sean Corfield
867d5d3482
Implement composite; clean up readme
2020-09-28 19:24:17 -07:00
Sean Corfield
6d31c4839d
Add first pass of helpers
2020-09-28 13:47:55 -07:00
Sean Corfield
a7590e9216
Enhance special syntax
...
Pass op in as first argument so we can write more generic functions.
2020-09-28 13:18:21 -07:00
Sean Corfield
0706d0b7ba
Improve insert into support
2020-09-28 12:12:40 -07:00
Sean Corfield
534401e5d6
Add ILIKE/NOT-ILIKE
2020-09-28 12:12:25 -07:00
Sean Corfield
ad49c4e386
Add NOT operator, improve NULL support
2020-09-28 12:12:10 -07:00
Sean Corfield
804305d3c5
Add EXCEPT ALL
2020-09-28 11:52:32 -07:00
Sean Corfield
6db2426046
Fix do update set; add on conflict tests
2020-09-28 11:49:29 -07:00
Sean Corfield
61cf6eda5a
Add variadic string concatenation ||
2020-09-28 11:49:13 -07:00
Sean Corfield
25097af134
First cut of on conflict support
2020-09-26 15:16:12 -07:00
Sean Corfield
9154d73678
Implement returning (postgres)
2020-09-26 00:39:54 -07:00
Sean Corfield
002523bb8c
Generate AS for select/from; except for Oracle
2020-09-26 00:17:31 -07:00
Sean Corfield
6aced04179
Address #266 by adding :pretty? true option
...
Adds newline before, after, and between each SQL clause.
2020-09-25 23:58:51 -07:00
Sean Corfield
4d3b317520
Add meta unwrap for more feature support
2020-09-25 17:10:25 -07:00
Sean Corfield
0052aade7c
Implement variadic and/or/+/*
2020-09-25 16:40:15 -07:00
Sean Corfield
a6c1f98b71
Fix CTE syntax
...
Should always be wrapped in parens
2020-09-25 16:38:38 -07:00
Sean Corfield
1ebbbc1772
Fix inline string behavior
2020-09-25 16:38:11 -07:00
Sean Corfield
63a079ca8d
Bump readme version (and gen'd code)
2020-09-25 15:31:29 -07:00
Sean Corfield
9f20ade0fe
Fix is/not null generation
2020-09-25 15:31: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
Sean Corfield
6cf8fa9e45
Implement base clause order for more predictable dialect selection
2020-09-24 11:13:08 -07:00
Sean Corfield
ba701b60cd
Continue to support Clojure 1.7 for now
2020-09-24 11:04:18 -07:00
Sean Corfield
3ce47b92f2
Implement :inline syntax; allow select call without alias
2020-09-23 22:52:57 -07:00
Sean Corfield
97531fa4cf
Implement array as SQL syntax instead of special HoneySQL syntax
2020-09-23 22:25:13 -07:00
Sean Corfield
f7d5e3a4cf
Down to just 8 failures now!
...
Mising: array, inline, parameterizer.
2020-09-23 18:15:20 -07:00
Sean Corfield
1a699f18ab
Support more clauses; flesh out dialect and clause ordering
2020-09-23 12:55:02 -07:00
Sean Corfield
a1d90a6382
Work toward more 1.x compatibility
...
Temporarily disable `AS` in alias while testing compatibility; only
quoted by default if `:dialect` specified (may revisit this).
2020-09-23 00:14:25 -07:00
Sean Corfield
834ac3a096
Rename sql-format back to format now Chlorine is updated!
2020-09-21 10:56:05 -07:00
Sean Corfield
1dc0447244
Convert more RCFs to tests
2020-09-20 22:25:28 -07:00
Sean Corfield
b6d6d2c4f4
Refactor to sql-format for now
2020-09-20 21:33:04 -07:00
Sean Corfield
2c98d35f63
Start some tests; implement more clauses
2020-09-20 19:17:37 -07:00
Sean Corfield
29b6e47a8e
Experimental WIP
2020-09-20 18:48:07 -07:00
Sean Corfield
b3baa094c2
Fixes #257 by adding CROSS JOIN
2020-05-29 16:01:49 -07:00
Sean Corfield
d86150784b
Fixes #239 by never qualifying inserted column names
2020-05-18 12:06:20 -07:00
Sean Corfield
ac92047d5e
Refer/link to next.jdbc as appropriate
2020-03-08 15:40:08 -07:00
Sean Corfield
58a9a97694
Remove macrovich dependency
2020-03-08 15:30:48 -07:00
Sean Corfield
8784a104fb
Fixes #253 properly; logs #254 and #255 in CHANGES
2020-03-06 09:42:51 -08:00
Ted Coakley
e7dce6b347
Adds support for except set operation #254
2020-03-06 17:34:06 +00:00
Sean Corfield
9fb3d42660
Release 0.9.9 fixes #253
2020-03-02 16:01:14 -08:00
Sean Corfield
a732815b37
Fixes #249 by adding :namespace-as-table? option for 0.9.8
2019-09-07 23:42:38 -07:00
Sean Corfield
e7f2343ae7
Tweak argument names
2019-09-07 15:58:48 -07:00
Sean Corfield
bb73dcbda7
Fixes #162 by adding composite/:composite
...
Relies on paren-wrapping within subqueries which is the context for
values.
2019-09-07 15:56:06 -07:00
Sean Corfield
f17a6f5582
Fixes #247 by reverting #132 / #131
...
Adds `*allow-namespaced-names?*` Var and `:allow-namespaced-names?`
option so the previous behavior can still be used.
2019-09-07 15:18:10 -07:00
Sean Corfield
c573f3bd9c
Fixes #235 by adding two different SET priority variants
...
This allows the behavior change in #200 to be worked around.
2019-09-07 14:55:06 -07:00
Sean Corfield
4ca74f2b0d
Fixes #139 by checking columns arguments
2019-09-07 14:02:04 -07:00
Sean Corfield
7831ebed38
Fixes #128 by adding :truncate / truncate
2019-09-07 13:24:46 -07:00
Sean Corfield
94601ee5ae
Fixes #248 by changing how aliases are rendered
...
In theory, the only change here will be to stop the paren-wrapping in
generation of alias SQL -- but I think that treating alias/columns pairs
like this (as a nested alias) is very suspicious anyway so that probably
ought to be fixed "properly" at some point.
2019-09-05 16:38:20 -07:00
Sean Corfield
8bf68d1d10
Another run at fixing #246
2019-08-21 21:59:39 -07:00
Sean Corfield
a31426da6b
Fixes #246
...
Also fixes reflection warning introduced in #237 .
2019-08-21 16:03:21 -07:00
Sean Corfield
509df19702
Fix #242 by turning modifiers into a multimethod
2019-04-06 20:30:16 -07:00
Sean Corfield
05cc39a41c
Revert #240 but keep the dependency updates
2019-04-02 11:25:15 -07:00
Sean Corfield
d10166c0ed
Fix #240 by extending keyword call syntax
...
Also updates dev/test dependencies.
2019-03-27 10:51:26 -07:00
Cam Saul
bd076b193a
Fix query generation when user.language is Turkish
2019-02-08 20:02:31 -08:00
Griffin Smith
8c2142cb34
bind *parameterizer* in format-predicate
...
format-predicate throws an NPE if *parameterizer* is not bound - this
mirrors the binding form of `format` to allow supplying that as an
option.
2019-01-07 17:19:52 -05:00
Gordon Stratton
5faae8790f
The "AS" alias is no longer split before quoting
...
Fixes #216
2018-10-01 15:19:03 +00:00
Sean Corfield
ea3e9b40bd
Fix #228 by allowing no predicates in where/merge-where
2018-09-24 18:44:01 -07:00
Sean Corfield
284d0142b6
Fix #226 by adding assert
2018-09-02 18:35:02 -07:00
Vincent
6e3631822d
Added Inlinable protocol for more sensible stringification of inline values, and to allow library users to further extend the inline behavior ( #224 )
2018-08-30 18:55:53 +02:00
Sean Corfield
2b238c5a47
Fix #221 by treating #inline nil as a special case
2018-08-03 17:13:46 -07:00
Sean Corfield
61d8926a63
First cut for #219
2018-06-29 21:59:17 -07:00
Sean Corfield
ea76608c7c
Merge branch 'delete' of https://github.com/MichaelBlume/honeysql into MichaelBlume-delete
...
Corrects `delete` to support multiple tables.
Adds tests.
Adds README examples.
# Conflicts:
# src/honeysql/format.cljc
# src/honeysql/helpers.clj
2018-06-26 18:24:01 -07:00
Chris Targett
f778419cb9
Refactored parameterizer to use mutimethods
...
It was briefly mentioned in #honeysql on clojurians.slack.com that this
mechanism of extension uses a register method and an atom to support
extension when multimethods are used elsewhere.
2018-05-15 21:22:32 +01:00
Michael Blume
fcdf326968
Put SET after JOIN
...
Fix #200
2018-04-15 23:51:35 -07:00
Michael Blume
43e94bf497
Merge pull request #201 from vincent-dm/master
...
adds support for JOIN ... USING (...) syntax (#188 )
2018-04-12 23:39:59 -07:00
Juvenn Woo
e874a6114d
Replace alter-var-root with atom for parameterizers
2018-03-09 14:11:50 +08:00
Juvenn Woo
2abe128008
Support register customized parameterizer
2018-03-09 11:54:14 +08:00
Nuttanart Pornprasitsakul
3206b099df
Remove nil predicate from :and
2018-02-18 13:27:07 +07:00
Nuttanart Pornprasitsakul
15af00e0de
Remove nil argument to where
2018-02-15 22:44:13 +07:00
Michael Blume
3588768970
Merge pull request #195 from madvas/master
...
Fix #193
2018-02-10 23:50:22 -08:00
Michael Blume
8ad38d28af
Merge pull request #196 from emidln/emidln/insert-into-drop-parens
...
Avoid wrapping QUERY with parens while formatting INSERT INTO ... QUERY
2018-02-10 23:48:01 -08:00
Vincent
8a6ecd94aa
adds support for JOIN ... USING (...) syntax ( #188 )
2018-01-16 03:13:14 +01:00
Tianxiang Xiong
ccff2d2c23
Limit value context to sequences in value positions
...
Fix #198
2018-01-09 23:42:53 -08:00
Brandon Adams
c7df208e3e
Avoid wrapping QUERY with parens while formatting INSERT INTO ... QUERY
...
This also adds a test using honeysql.format/format for an existing
format-clause test case for :insert-into which encodes the previously
failing behavior.
2017-12-12 16:09:31 -06:00
madvas
54b620d0f9
Fix #193
2017-11-29 19:41:35 +01:00
Michael Blume
faba02f2b4
Merge pull request #186 from arichiardi/parameterizer-none
...
Add :parameterizer :none option
2017-11-15 21:23:11 -08:00
Ken Fehling
7f64e26984
Add :intersect to default-clause-priorities
2017-11-15 18:59:54 -05:00
Andrea Richiardi
6cf89436d4
Add :parameterizer :none option
...
Sometimes you want to completely skip using parameters.
Postgres, in particular, complains with cryptic "syntax error at or near "$1"
whenever query parameters cannot be used for the query. An example would be
CREATE TABLE queries where the only parameters are the VARCHAR size.
This patch adds a :none option to :parameterizer which completely skips
parameter filling (and numbering), returning the SQL string only.
2017-11-06 17:13:02 -08:00
Andrea Richiardi
65037939b2
[ Fix #167 ] Add ClojureScript self-host support
...
This patch uses the wonderful cgrand/macrovich for supporting both JVM and
self-host ClojureScript. The library avoids destructive code changes, no
namespaces were moved.
The patch also adds a runner for self-host tests by adding the lein-tach
plugin. Tests can be launched with:
lein tach lumo (or planck)
See the lein-tach README for details.
2017-11-01 10:13:47 -07:00