Commit graph

225 commits

Author SHA1 Message Date
Sean Corfield
aed1938e89 Merge branch 'develop' into multi-rs 2020-06-22 17:06:01 -07:00
Sean Corfield
b9b77bb40f Fixes #122 by adding next.jdbc/with-options 2020-06-22 16:38:13 -07:00
Sean Corfield
067919a296 Roll multi-rs across execute-all for all types 2020-06-07 12:13:32 -07:00
Sean Corfield
92f7923a2a Merge branch 'master' into multi-rs
# Conflicts:
#	test/next/jdbc/test_fixtures.clj
2020-06-07 10:05:33 -07:00
Sean Corfield
509e065fbf Fixes #115 by providing do-commands example 2020-06-07 10:01:12 -07:00
Sean Corfield
cfd403301f Improve readability of informational messages in tests 2020-06-07 09:40:05 -07:00
Sean Corfield
e201abdc1e Merge jTDS, updated PostgreSQL testing to multi-rs 2020-06-06 17:26:28 -07:00
Sean Corfield
6167440500 jTDS support; PostgreSQL 12.2.0 support 2020-06-06 17:16:17 -07:00
Sean Corfield
5e98c828a5 Add jTDS testing 2020-06-06 17:06:11 -07:00
Sean Corfield
73aea0ceef Add in jTDS tests 2020-06-06 17:05:27 -07:00
Sean Corfield
326977dddc :multi-rs truthy defaults to sequnce; :delimited available #116 2020-06-06 17:01:13 -07:00
Sean Corfield
ec31aaa427 Add in jTDS tests 2020-06-06 17:01:07 -07:00
Sean Corfield
9240d41ed6 Rename/cleanup log4j2 config 2020-06-06 17:00:59 -07:00
Sean Corfield
0a27e51f37 First steps to multiple result sets #116 2020-06-06 17:00:52 -07:00
Sean Corfield
3a6539f3e2 Switch to zonky embedded PG; add jtds testing; add logging control 2020-06-06 17:00:39 -07:00
Sean Corfield
cc1781d3fb Adjust tests to match new exception handling 2020-05-31 17:42:07 -07:00
Sean Corfield
53c3b5f48e Bump java.data to 1.0.78 and surface configurable exception handling 2020-05-31 17:12:38 -07:00
Sean Corfield
ab588070e6 Datafy parameter metadata 2020-05-31 12:23:31 -07:00
Sean Corfield
4be2b7130b Extend datafication and simplify
Handles weird SQLite edge case; datafies Statement and ResultSet; 
improves exception handling in `safe-bean` (but we really need a better 
bean maker).
2020-05-31 03:02:25 -07:00
Sean Corfield
e406c90d6f Test result set metadata 2020-05-31 01:04:29 -07:00
Sean Corfield
0952503860 DatabaseMetaData datafication tests 2020-05-31 00:56:44 -07:00
Sean Corfield
db95d370d8 Linter cleanup 2020-05-31 00:20:00 -07:00
Sean Corfield
332cf4a3ed Fix protocols vs namespace for datafy 2020-05-31 00:19:48 -07:00
Sean Corfield
6a6e42e9af Expand datafy/nav and metadata support (work in progress) 2020-05-30 23:44:18 -07:00
Sean Corfield
91b1b25475 Fixes #110 by documenting the solution
In addition to adding `row-number` and `column-names`, this also adds 
support for associative access by numeric key and indexed access.
2020-05-23 00:01:39 -07:00
Sean Corfield
1b2ce9767e Remove spurious comment in test 2020-05-22 22:43:11 -07:00
Sean Corfield
b0b9e53352 Addresses #110 by adding tests around this scenario 2020-05-22 20:16:40 -07:00
Sean Corfield
ec97d0affb Add array handling tip to changelog 2020-05-08 10:34:44 -07:00
Sean Corfield
f0c4159bff Support loginTimeout on reified DataSource 2020-03-20 13:51:50 -07:00
Sean Corfield
eda9c93a1c Alpha-order of DB tests 2020-03-18 11:35:18 -07:00
Sean Corfield
780c759541 Complete support for MariaDB #100
Adds tests and test dependencies, based on a new environment variable. 
Updates change log. Documents difference in generated key return between 
MySQL and MariaDB.
2020-03-16 15:19:21 -07:00
Sean Corfield
126ac58c34 Fixes #88 by calling 1-arity keyword
Also supports calling `:qualifier-fn` on an empty table name.
2020-02-26 11:48:42 -08:00
Sean Corfield
425d1c367c Extend copyright to 2020 2020-01-01 13:13:41 -08:00
Sean Corfield
d2b898d044 Ensure result set tests are instrumented 2019-12-20 15:48:08 -08:00
Sean Corfield
a2ba8ff780 Fixes #82 and adds next.jdbc.prepare/statement 2019-12-20 15:45:22 -08:00
Sean Corfield
205abe2faa Fixes #81 by splitting next.jdbc.sql 2019-12-11 16:42:28 -08:00
Sean Corfield
b6014e824a Fixes #80 by carefully avoiding the implicit commit when rollback fails 2019-12-11 16:03:41 -08:00
Sean Corfield
e0c330b707 Make it easier to switch databases in the REPL 2019-11-16 00:50:50 -08:00
Sean Corfield
2b385a6ec5 Add an RCF that uses t.d.a. add-lib to load test deps
This makes it easier for me to develop and test `next.jdbc` in the same 
REBL setup I use for World Singles Networks development.
2019-11-16 00:36:32 -08:00
Sean Corfield
5b795f95a7 Add optional MS SQL Server testing 2019-11-15 22:37:42 -08:00
Sean Corfield
774e08236f Add optional MySQL testing 2019-11-15 15:38:51 -08:00
Sean Corfield
7b6aa69e31 Fixes #73 by adding optional namespace to extend SettableParameter 2019-11-14 17:10:49 -08:00
Sean Corfield
d561a7108e Fixes #75 by adding java.sql.Statement support 2019-11-14 16:15:52 -08:00
Sean Corfield
b38afcb501 Remove unused require 2019-11-13 10:52:17 -08:00
Sean Corfield
e82094dd86 Expand test for #73 to other databases
This verifies that it is _only_ PostgreSQL that cannot do this 
conversion!
2019-11-13 10:51:14 -08:00
Sean Corfield
e404c47d83 Fixes #74 by mollifying Eastwood 2019-11-13 10:40:59 -08:00
Sean Corfield
9626d29d5c Tidy up test output 2019-11-13 09:42:42 -08:00
Sean Corfield
ccf83a2c0a Merge branch 'master' of github.com:seancorfield/next-jdbc 2019-11-13 09:38:51 -08:00
Sean Corfield
4b01f31578 Move middleware experiment to tests
Until I figure out what to do about this, I don't want it accidentally 
included in a release!
2019-11-13 09:38:30 -08:00
Sean Corfield
37327c5870 Breaking test for #73
Why, PostgreSQL, why?
2019-11-12 20:54:45 -08:00
Sean Corfield
e9b7ee80ab Document current state of experiment
and my unhappiness with it!
2019-11-10 17:53:23 -08:00
Sean Corfield
a57011a998 Recast the adapter/processors as a middleware
Still not happy with this but it seems more "holistic".
2019-11-09 22:59:34 -08:00
Sean Corfield
b2b7696973 Sketch of side-effecting builder-adapter 2019-11-08 12:47:54 -08:00
Sean Corfield
dd70625e8f Clarify behavior when no rows match a query 2019-11-01 09:34:14 -07:00
Sean Corfield
61083eba69 Address #70 by adding/documenting CLOB column reader example 2019-10-14 11:13:36 -07:00
Sean Corfield
6482d38960 Use high-level API for CLOB tests 2019-10-14 10:36:31 -07:00
Sean Corfield
90f27cab3d Add tests for reading/writing clob columns 2019-10-14 10:31:11 -07:00
Sean Corfield
04237c89ea Add optional maps adapter 2019-10-04 13:52:23 -07:00
Sean Corfield
bae139d3a2 Fixes #67 by adding test for jdbcUrl spec 2019-10-02 09:19:31 -07:00
Sean Corfield
6c42d7ce67 Fixes #66 by adding support for :jdbcUrl in db-spec hash map 2019-09-27 13:06:45 -07:00
Sean Corfield
2c51c549d6 Fixes #60 by documenting/testing simpler :schema format 2019-09-09 16:22:25 -07:00
Sean Corfield
296cd51aa5 PostgreSQL IN/= ANY(?) test
Hopefully documentation to come!
2019-09-04 18:43:30 -07:00
Sean Corfield
9a76e4c25a Add as-arrays-adapter 2019-08-21 14:47:55 -07:00
Sean Corfield
57f146ee41 Add test for as-maps-adapter 2019-08-21 14:37:19 -07:00
Sean Corfield
e0b0c214fd Improve printability as part of #51
Since `str` may be able to realize a row and render it as a string, attempts to print a row use this route to circumvent `print-sequential` failing due to lazy evaluation.
2019-08-02 12:42:00 -07:00
Sean Corfield
0fd8bf1a88 Fixes #51 by implementing IPersistentMap in full
* `dissoc`, `cons`, `=` -- both realize a full row.
* `count`, `empty` -- do not realize rows, `empty` doesn't use the builder at all.
* `str` -- attempts to realize a row (else returns the same "helpful" string as before).
2019-08-02 12:24:04 -07:00
Sean Corfield
9372ce11cd Fix #50 by testing against (embedded) PostgreSQL
This is the first database that returns lowercase columns in results so 
there are a lot of conditionals in the tests now. It also returns entire 
rows on inserts instead of just the generated key.
2019-07-24 17:32:58 -07:00
Sean Corfield
697e4a840f Improve connection pool tests 2019-07-18 11:24:13 -07:00
Sean Corfield
b1b2f13ebb Rename jdbc-url to ->pool 2019-07-18 11:01:55 -07:00
Sean Corfield
60c1e6660f Support connection pooling more easily 2019-07-17 23:50:56 -07:00
Sean Corfield
44dba4f29c Fixes #46 by allowing :host :none
Also adds `:dbname-separator` and `:host-prefix` for fine-grained 
control over the JDBC URL format.
2019-07-11 15:43:49 -07:00
Sean Corfield
4457161305 Assert/spec/tests for empty cols in insert-multi! 2019-07-11 12:52:36 -07:00
Sean Corfield
4d7a5a440b Fix #43 by relaxing the spec for insert-multi!
Adds tests for `insert-multi!` that pass sequences instead of vectors.
2019-07-11 12:34:02 -07:00
Sean Corfield
821f9b1a5a Fixes #44
Also adds `assert`s in SQL-generating functions, instead of just 
producing illegal SQL.
2019-07-11 12:11:32 -07:00
Sean Corfield
29d46439e6 Fixes #40 by adding next.jdbc.prepare/execute-batch! 2019-07-09 16:00:10 -07:00
Sean Corfield
7184ef996c Fixes #41; Addresses #40; Expand prepared statement documentation
* Combine adjacent `with-open` calls.
* Show how `set-parameters` is used.
* Add a section on batched parameters, with their caveats, and how to 
use them.
2019-07-08 20:48:56 -07:00
Sean Corfield
ba4dc837e1 Fixes #33 by improving specs 2019-07-02 18:50:25 -07:00
Sean Corfield
1fe7e92df2 Fixes #34 by adding save point tests
And updating the Transactions documentation to show save point examples.
2019-07-02 18:36:00 -07:00
Sean Corfield
1cec0a2643 Fixes #37; Fixes #36
* Fix `with-transaction` spec and how it invokes `transact` when no 
options map is provided.
* Adds type hint to `with-transaction`.
* Document manual rollback of transactions.
2019-07-02 16:45:48 -07:00
Sean Corfield
e1b42b1804 Address #31 by improving string representation of reified objects
At least this should give a hint as to what you did wrong...
2019-06-11 16:47:58 -07:00
Sean Corfield
22a3f2bb5f Fix #26 by adding datafiable-result-set
This makes handling metadata result sets much easier.
2019-06-08 15:09:42 -07:00
Sean Corfield
b64fbf35ff Fix #30 by adding modified builders
Adds `:label-fn` and `:qualifier-fn` options, and `as-modified-*` 
builder variants.
2019-06-04 18:01:19 -07:00
Sean Corfield
fdfb0697ec Address #24 by setting warn on reflection in tests
This highlights the reflection on `.close` (in the connection tests).
2019-05-29 09:04:21 -07:00
Sean Corfield
792bf242d7 Add a stub test namespace for specs
Just for consistency and completion.
2019-05-26 16:15:33 -07:00
Sean Corfield
6a9df0f4aa Fix #22 by adding next.jdbc.optional
Includes four `as*maps` builders that omit `NULL` columns completely 
from the returned row hash maps.
2019-05-25 19:16:30 -07:00
Sean Corfield
a32c5b9e66 Address #16 by renaming reducible! to plan for Beta 1 2019-05-22 16:22:14 -07:00
Sean Corfield
adf5a03e05 Address #21 by adding next.jdbc.specs
Docs still need to be updated for this!
2019-05-21 21:45:05 -07:00
Sean Corfield
fa73bb800b Fix tests for 1.0.0-alpha13 2019-05-05 00:04:44 -07:00
Sean Corfield
8d7f1b54da Ensure jdbc-test can be run standalone 2019-05-01 16:21:23 -07:00
Sean Corfield
cf75268087 Rename :gen-fn to :builder-fn 2019-04-24 14:22:35 -07:00
Sean Corfield
2702a01773 Multi-DB testing
Instead of just testing against H2 in-memory, we now test against Derby, 
H2 in-memory, H2 on-disk, hsqldb, and SQLite
2019-04-21 17:10:29 -07:00
Sean Corfield
03b09f6e03 Alpha 5; fixes #12 by adding :order-by option to for-query 2019-04-21 13:42:33 -07:00
Sean Corfield
c2c798770a Alpha 4; fixes #11 by adding schema meta-quoting function 2019-04-21 13:00:03 -07:00
Sean Corfield
214470bf9d Use auto_increment so H2 will return generated keys
Also update the result set builder used in one test
2019-04-20 23:42:22 -07:00
Sean Corfield
2ab35132a7 Document Result Set Builders
And sketch out the remaining documentation outline.
2019-04-20 22:00:40 -07:00
Sean Corfield
9b3eeb02d3 Test SQL-level DB functions 2019-04-19 23:25:03 -07:00
Sean Corfield
228335d2f3 Turn all the examples into tests 2019-04-19 22:51:48 -07:00
Sean Corfield
19dc0e4703 Add test based on record/custom builder 2019-04-19 22:50:29 -07:00
Sean Corfield
e3c193e936 Add a test for -execute-all 2019-04-19 21:59:42 -07:00
Sean Corfield
12e396683c Add tests for map-like reducible! result set
Ensures basic associative/lookup access do not cause row building; 
ensures assoc/seq produce real maps; ensure datafiable-row produces a 
real map with metadata.
2019-04-19 21:53:55 -07:00
Sean Corfield
bfda745a70 Add row builder tests; fix row builder bug in execute-one 2019-04-18 23:03:09 -07:00
Sean Corfield
d5ee7defd9 Test cleanup 2019-04-18 22:43:27 -07:00
Sean Corfield
d4f79a68fd Add datafication tests; fix regex bug! 2019-04-18 22:43:19 -07:00
Sean Corfield
42cfe88859 Stub test namespaces
Outline some of the things we might test.
2019-04-18 21:51:58 -07:00
Sean Corfield
3b0b059f62 Add connection tests
Improve handling of relative files with H2 database connections.
2019-04-18 21:35:38 -07:00
Sean Corfield
d59b1ec2fb Basic SQL tests and bug fix!
Multi-row insert did not apply `:column-fn` correctly.
2019-04-18 18:31:15 -07:00
Sean Corfield
67a2d3918c Basic quoted tests 2019-04-18 18:30:38 -07:00
Sean Corfield
e1fa7055b4 Stub test namespaces
Yes, real tests are coming soon...
2019-04-18 14:15:15 -07:00
Sean Corfield
f7c753d696 Update tests and timings 2019-04-18 08:13:16 -07:00
Sean Corfield
7b98b7337c One more example 2019-04-18 00:43:10 -07:00
Sean Corfield
86db20b94b Improve default behavior of reducible! when forced to create a row
Defaults to `map-row-builder`; add examples of `assoc`, 
`datafiable-row`.
2019-04-18 00:36:22 -07:00
Sean Corfield
b82f349717 Add example row builder for record
Note: this makes a lot of assumptions about the shape of the result 
set's rows!
2019-04-18 00:28:55 -07:00
Sean Corfield
5019995feb Move SQL sugar functions to next.jdbc.sql
Make SQL string builder functions private.
2019-04-17 23:56:44 -07:00
Sean Corfield
b5eb5b880e Consolidate the three use cases
* Remove `execute!` and `execute-one!` from `result-set`.
* Add `-execute-all` and `-execute-one` to the `Executable` protocol 
instead.
* Remove `:row-fn` support.
* Allow a `PreparedStatement` to be `Connectable` so it can be used with 
`datafy`/`nav`.
* Rewrite `RowBuilder` protocol and add `ResultSetBuilder` protocol; add 
`as-arrays` as a builder.
2019-04-17 23:34:31 -07:00
Sean Corfield
788015909f First cut at RowBuilder
Temporarily disables as-arrays
2019-04-10 23:59:19 -07:00
Sean Corfield
d2f0afa973 Fix #9 by combining ->factory and create again 2019-04-10 21:46:38 -07:00
Sean Corfield
e85f627a00 Address #2 by solidifying row function API
Low-level `execute!` requires row function to be passed. High-level API 
allows row function, else `datafiable-row`. Syntactic sugar still uses 
`:row-fn`.
2019-04-02 00:41:39 -07:00
Sean Corfield
c2c9bcbba4 Address #1 by solidifying syntactic sugar functions
Cleans up how options are handled. Adds `query` alias for `execute!`, 
clarifiies the syntactic sugar nature of the additional functions.
2019-04-01 23:57:12 -07:00
Sean Corfield
f217e86038 Address #2 by adding rs/as-arrays 2019-04-01 22:19:02 -07:00
Sean Corfield
28f735bafd Add benchmarks against clojure.java.jdbc 2019-04-01 20:37:14 -07:00
Sean Corfield
6e08557d92 Add docstrings to everything 2019-03-31 23:17:12 -07:00
Sean Corfield
8646472e79 Flesh out more SQL generators
Add high-level insert!, insert-multi!, update!, delete!

Add more examples to tests.
2019-03-31 19:30:01 -07:00
Sean Corfield
38017d720d Move examples to tests for now 2019-03-31 17:29:40 -07:00
Sean Corfield
954a1ed306 First functioning version of execute! 2019-01-07 23:03:20 -08:00
Sean Corfield
a8c1c37cfd Baseline project setup 2019-01-07 20:38:58 -08:00