Only accretive/fixative changes will be made from now on.
1.3.981 -- 2024-12-13
1.3.967 -- 2024-12-02
:dbtype "xtdb"
.:return-keys true
.Connection
objects for active TXs, which relaxes several of the conditions around nested transactions.assert
calls with proper validation, throwing IllegalArgumentException
on failure.:name-fn
option since the driver for it no longer exists (qualified columns names in XTDB).1.3.955 -- 2024-10-06
ANY(array)
.:name-fn
as an option (primarily for the SQL builder functions, but also for result set processing); the default is clojure.core/name
but you can now use next.jdbc.sql.builder/qualified-name
to preserve the qualifier.~ [This was removed in 1.3.967 since XTDB no longer supports qualified column names]docker-compose
=> docker compose
.1.3.939 -- 2024-05-17
1.3.925 -- 2024-03-15
next.jdbc.sql/aggregate-by-keys
as a convenient wrapper around find-by-keys
when you want just a single aggregate value back (such as count
, max
, etc).insert-multi!
and insert!
.clj-kondo
.1.3.909 -- 2023-12-16
:schema-opts
option to override the default conventions for identifying foreign keys in columns.insert-multi!
accept empty rows (and producing an empty result vector). This improves compatibility with clojure.java.jdbc
.deps.edn
).java.data
to 1.1.103 so that next.jdbc
no longer has a transitive dependency on org.clojure/tools.logging
!reduce
on the result of plan
, you must provide an initial value.next.jdbc.sql/find-by-keys
to show LIKE
and IN
clauses.tools.build
to 0.9.6 (and get rid of template/pom.xml
in favor of new :pom-data
option to b/write-pom
).1.3.894 -- 2023-09-24
fdef
spec for with-transaction
more permissive. Also add specs for on-connection
and the +options
variants of both macros.with-transaction+options
and on-connection+options
..getGeneratedKeys()
is called so you cannot use :return-generated-keys true
with it but you can add RETURNING *
to your SQL statements instead (the tests have been updated to reflect this).tools.build
to 0.9.5 (and remove :java-opts
from build/test
)1.3.883 -- 2023-06-25
next.jdbc/active-tx?
and adding more explanation to Transactions about the conventions behind transactions and the limitations of thread-local tracking of active transactions in next.jdbc
.next.jdbc/with-logging
docstring.1.3.874 -- 2023-04-15
1.3.865 -- 2023-03-31
1.3.862 -- 2023-03-13
1.3.858 -- 2023-03-05
.clj_kondo
extension for hook files.run!
over plan
.1.3.847 -- 2022-11-04
as-cols
in insert-multi!
SQL builder. Thanks to @changsu-farmmorning for spotting that bug!next.jdbc.connect/uri->db-spec
which converts a URI string to a db-spec hash map; in addition, if DriverManager/getConnection
fails, it assumes it was passed a URI instead of a JDBC URL, and retries after calling that function and then recreating the JDBC URL (which should have the effect of moving the embedded user/password credentials into the properties structure instead of the URL).PreparedStatement
caveat to the Oracle Tips & Tricks section.on-connection
to exported clj-kondo
configuration.run-test
from sh
to bb
.1.3.834 -- 2022-09-23
1.3.828 -- 2022-09-11
.cons
on a row.:column-fn
a top-level option in plan
-related functions to transform keys used in reducing function contexts. Also corrects handling of column names in schema nav
igation (which previously only supported :table-fn
and incorrectly applied it to columns as well).:extend-via-metadata true
after the protocols' docstrings.:useBulkCopyForBatchInsert
for Microsoft SQL Server via PR #216 -- danskarda.clojure_test
DB in MySQL if needed; also streamline the CI processes.docker-compose
.1.2.796 -- 2022-08-01
1.2.790 -- 2022-07-29
:datasource
or :connection-uri
(this is otherwise undocumented and intended to aid migration from clojure.java.jdbc
).insert-multi!
to accept a sequence of hash maps and also to support batch execution, via PR #206 -- @rschmukler.1.2.780 -- 2022-04-04
1.2.772 -- 2022-02-09
datafy
/nav
, make rows directly nav
able (even though this is not really the correct behavior).get-datasource
and get-connection
.execute-batch!
for with-options
and with-logging
(and this should generalize to any wrapper that satisfies Connectable
and stores the actual Connection
under the :connectable
key).build-clj
to v0.6.7.1.2.761 -- 2021-12-15
;
).build-clj
to v0.6.3.1.2.753 -- 2021-11-17
clj-kondo.exports
for future expansion (with-transaction
is already built into clj-kondo
).pom.xml
template cleanup.build-clj
to v0.5.4.1.2.737 -- 2021-10-17
java.data
to 1.0.92 and documenting HikariCP's :dataSourceProperties
.:jdbcUrl
.1.2.731 -- 2021-10-04
execute-batch!
.build-clj
to v0.5.0.1.2.724 -- 2021-09-25
next.jdbc
compatible with GraalVM 22+ (PR #178, @FieryCod).1.2.709 -- 2021-08-30
:property-separator
from "etc" map and defaulting H2 to ";"
for this.tools.build
for running tests and JAR building etc.1.2.689 -- 2021-08-01
DatafiableRow
to ResultSet
so there's a public method to call on (rows of) a JDBC result set directly.clojure.java.jdbc
functions inside next.jdbc/with-transaction
and discuss how to migrate transaction-based code in the Migration guide.with-transaction
in Getting Started.depstar
, test-runner
, and CI versions. Add example build.clj
to run tests in a subprocess (purely educational).1.2.674 -- 2021-06-16
:property-separator
to next.jdbc.connection/dbtypes
and using it in jdbc-url
.next.jdbc/with-logging
to create a wrapped connectable that will invoke logging functions with the SQL/parameters and optionally the result or exception for each operation.:unit_count
references in Getting Started (were :unit_cost
).test-runner
.1.2.659 -- 2021-05-05
clj-commons/camel-snake-kebab
an unconditional dependency. [Being a conditional dependency that could be brought in at runtime caused problems with GraalVM-based native compilation as well as with multi-project monorepos]1.1.646 -- 2021-03-15
execute-batch!
to work with datasources and connections, and providing the SQL statement directly.1.1.643 -- 2021-03-06
com.github.seancorfield/next.jdbc
(although new versions will continue to be deployed to seancorfield/next.jdbc
for a while -- see the Clojars Verified Group Names policy).next.jdbc.transaction/*nested-tx*
more thoroughly since that difference from clojure.java.jdbc
has come up in conversation a few times recently.:allowMultiQueries true
as an option for MySQL/MariaDB to allow multiple statements to be executed and multiple result sets to be returned.next.jdbc.prepare/execute-batch!
to next.jdbc/execute-batch!
(to avoid a circular dependency that previously relied on requiring next.jdbc.result-set
at runtime -- which was problematic for GraalVM-based native compilation); next.jdbc.prepare/execute-batch!
is deprecated: it will continue to exist and work, but is no longer documented. In addition, next.jdbc.prepare/execute-batch!
now relies on a private volatile!
in order to reference next.jdbc.result-set/datafiable-result-set
so that it is GraalVM-friendly. Note: code that requires next.jdbc.prepare
and uses execute-batch!
without also requiring something that causes next.jdbc.result-set
to be loaded will no longer return generated keys from execute-batch!
but that's an almost impossible path since nearly all code that uses execute-batch!
will have called next.jdbc/prepare
to get the PreparedStatement
in the first place.1.1.613 -- 2020-11-05
camel-snake-case
is properly required before use in an uberjar context.1.1.610 -- 2020-10-19
"duckdb"
to next.jdbc.connection/dbtypes
.next.jdbc.types/as-*
functions to use a thunk instead of a vector to convey metadata, so that wrapped values do not get unpacked by HoneySQL.ResultSet
, so that reducible-result-set
and foldable-result-set
can be exposed for folks who want more control over processing result sets obtained from database metadata.datafiable-result-set
can now be called without the connectable
and/or opts
arguments; a nil
connectable now disables foreign key navigation in datafied results (rather than throwing an obscure exception).1.1.588 -- 2020-09-09
next.jdbc.plan/select-one!
and next.jdbc.plan/select!
.ResultSet.getMetaData()
returns null
, we assume the column count is zero, i.e., an empty result set. This should "never happen" but some JDBC drivers are badly behaved and their idea of an "empty result set" does not match the JDBC API spec.1.1.582 -- 2020-08-05
next.jdbc.connection/jdbc-url
to build :jdbcUrl
values that can be passed to ->pool
or component
.1.1.581 -- 2020-08-03
bool
and bit
columns in a new Tips & Tricks section, inspired by #134.:return-generated-keys
as an option on execute-batch!
.1.1.569 -- 2020-07-10
next.jdbc/with-options
and next.jdbc.prepare/statement
; correct spec for next.jdbc.connection/component
. PR #131 from @Briaoeuidhtns.clojure.lang.ILookup
on the three builder adapters.with-column-value
to RowBuilder
and a more generic builder-adapter
.next.jdbc/snake-kebab-opts
, next.jdbc/unqualified-snake-kebab-opts
, next.jdbc.result-set/as-kebab-maps
, and next.jdbc.result-set/as-unqualified-kebab-maps
(which are present only if camel-snake-kebab
is on your classpath). As of 1.2.659, these are included unconditionally and next.jdbc
depends directly on camel-snake-kebab
.:rewriteBatchedStatements true
(plural). Also surface the batch statement tips in the Tips & Tricks page.plan
.1.1.547 -- 2020-06-29
plan
foldable (in the clojure.core.reducers
sense).next.jdbc.sql.builder/for-query
to support :top
(SQL Server), :limit
/ :offset
(MySQL/PostgreSQL), :offset
/ :fetch
(SQL Standard) for find-by-keys
.next.jdbc.transaction/*nested-tx*
to provide control over how attempts to create nested transactions should be handled.:multi-rs
option to execute!
to retrieve multiple result sets, for example from stored procedure calls or T-SQL scripts.:all
to be passed into find-by-keys
instead of an example hash map or a where clause vector so all rows will be returned (expected to be used with :offset
etc to support simple pagination of an entire table).:columns
option to find-by-keys
(and get-by-id
) to specify a subset of columns to be returned in each row. This can also specify an alias for the column and allows for computed expressions to be selected with an alias.1.0.478 -- 2020-06-24
next.jdbc.types
namespace, full of auto-generated as-xxx
functions, one for each of the java.sql.Types
values.1.0.476 -- 2020-06-22
next.jdbc.sql
functions.1.0.475 -- 2020-06-22
"jtds"
database driver (against MS SQL Server), making it officially supported.next.jdbc.prepare/statement
being incorrectly type-hinted.next.jdbc/with-options
that lets you wrap up a connectable along with default options that should be applied to all operations on that connectable.row-number
, column-names
, and metadata
.db-do-commands
in the clojure.java.jdbc
migration guide.1.0.462 -- 2020-05-31
next.jdbc.datafy
to provide more datafy
/nav
introspection (see the additional section in datafy, nav, and :schema for details).next.jdbc.result-set/metadata
to provide (datafied) result set metadata within plan
.1.0.445 -- 2020-05-23
plan
for "metadata" access: row-number
and column-names
can be called on the abstract row (even after calling datafiable-row
). In addition, Associative
access via numeric "keys" will read columns by index, and row abstractions now support Indexed
access via nth
(which will also read columns by index). Fixes #110.next.jdbc.connection/component
. See updated Getting Started guide for usage.execute-batch!
.locking
on Connection
object.1.0.424 -- 2020-04-10
BLOB
columns as byte[]
instead of java.sql.Blob
.:return-keys
.jdbc:
..getLoginTimeout
/.setLoginTimeout
on the reified DataSource
returned by get-datasource
when called on a hash map "db-spec" or JDBC URL string.1.0.409 -- 2020-03-16
NEXT_JDBC_TEST_MARIADB=true
as well as NEXT_JDBC_TEST_MYSQL=true
in order to run tests against MariaDB.1.0.405 -- 2020-03-14 (no code changes -- just documentation)
plan
so reduce
etc is more obvious.1.0.395 -- 2020-03-02
read-as-instant
and read-as-local
functions to next.jdbc.date-time
to extend ReadableColumn
so that SQL DATE
and TIMESTAMP
columns can be read as Java Time types.next.jdbc.date-time
to enable automatic conversion of java.util.Date
objects to SQL timestamps for prepared statements (#95).1.0.384 -- 2020-02-28
Unknown dbtype
exception message (to clarify that :classname
is also missing, #90).keyword
call when table name unavailable (or :qualifier-fn
returns nil
or an empty string); also allows :qualifier-fn
function to be called on empty table name (so :qualifier-fn (constantly "qual")
will now work much like clojure.java.jdbc
's :qualifier "qual"
worked).next.jdbc.result-set
functions.1.0.13 -- 2019-12-20
clojure.java.data
-based support for setting arbitrary properties on Connection
and PreparedStatement
objects, post-creation. Note: this uses the Java reflection API under the hood.next.jdbc.prepare/statement
to create Statement
objects with all the options available to prepare
except :return-keys
.org.clojure/java.data
to 0.1.5 (for property setting).1.0.12 -- 2019-12-11
next.jdbc.sql
into next.jdbc.sql.builder
.:connectionInitSql
workaround for HikariCP/PostgreSQL and non-default schemas.1.0.11 -- 2019-12-07
java.sql.Date
and java.sql.Timestamp
.NEXT_JDBC_TEST_MSSQL=yes
and MSSQL_SA_PASSWORD
set to your local -- 127.0.0.1:1433
-- SQL Server sa
user password; assumes that it can create and drop fruit
and fruit_time
tables in the model
database).NEXT_JDBC_TEST_MYSQL=yes
and MYSQL_ROOT_PASSWORD
set to your local -- 127.0.0.1:3306
-- MySQL root
user password; assumes you have already created an empty database called clojure_test
).1.0.10 -- 2019-11-14
java.sql.Statement
to plan
, execute!
, and execute-one!
.next.jdbc.date-time
that can be required if your database driver needs assistance converting java.util.Date
(PostgreSQL!) or the Java Time types to SQL timestamp
(or SQL date
/time
).clojure.java.jdbc
. PR #71 (@laurio).next.jdbc.result-set/clob-column-reader
and next.jdbc.result-set/clob->string
helper to make it easier to deal with CLOB
column data.execute!
and execute-one!
produce when the result set is empty ([]
and nil
respectively, and there are now tests for this). Similarly for find-by-keys
and get-by-id
.:result-type
(scroll) and :concurrency
options will cause table names to be returned.plan
, execute!
, and execute-one!
instead, with a DSL library if you want!).clojure.java.jdbc
and next.jdbc
; add caveats about column name conflicts (in several places).datafy
/nav
documentation around :schema
.org.clojure/java.data
to "0.1.4"
(0.1.2 fixes a number of reflection warnings).1.0.9 -- 2019-10-11
execute-one!
vs execute!
vs plan
.:next.jdbc/update-count
.:jdbcUrl
version spec.next.jdbc.optional/as-maps-adapter
to provide a way to override the default result set reading behavior of using .getObject
when omitting SQL NULL
values from result set maps.1.0.8 -- 2019-09-27
:jdbcUrl
key (consistent with ->pool
) so that you can create a datasource from a JDBC URL string and additional options.next.jdbc.specs/unstrument
. PR #64 (@gerred).:qualifier
(clojure.java.jdbc
) migration, with a specific caveat about Oracle not fully supporting .getTableName()
.1.0.7 -- 2019-09-09
:table/column
is equivalent to the old [:table :column :one]
and [:table/column]
is equivalent to the old [:table :column :many]
. The older formats will continue to be supported but should be considered deprecated. PR #62 (@seancorfield).ANY(?)
and arrays in PostgreSQL for IN (?,,,?)
style queries. Added a Tips & Tricks section to Friendly SQL Functions with database-specific suggestions, that starts with this one.1.0.6 -- 2019-08-24
insert-multi!
and execute-batch!
(addresses #57).ReadableColumn
and SettableParameter
protocols).clojure.string/lower-case
into one of the "modified" result set builders.next.jdbc.result-set/as-maps-adapter
and next.jdbc.result-set/as-arrays-adapter
to provide a way to override the default result set reading behavior of using .getObject
.org.clojure/test.check
to "0.10.0"
.1.0.5 -- 2019-08-05
IPersistentMap
fully for the "mapified" result set inside plan
. This adds support for dissoc
and cons
(which will both realize a row), count
(which returns the column count but does not realize a row), empty
(returns an empty hash map without realizing a row), etc.1.0.4 -- 2019-07-24
1.0.3 -- 2019-07-23
next.jdbc.connection/->pool
and documenting how to use HikariCP and c3p0 in the Getting Started docs (as well as adding tests for both libraries).ReadableColumn
and SettableParameter
.1.0.2 -- 2019-07-15
:host
to be :none
which tells next.jdbc
to omit the host/port section of the JDBC URL, so that local databases can be used with :dbtype
/:classname
for database types that next.jdbc
does not know. Also added :dbname-separator
and :host-prefix
to the "db-spec" to allow fine-grained control over how the JDBC URL is assembled.insert-multi!
with an empty rows
vector returns []
.insert-multi!
to "require less" of the cols
and rows
arguments.execute-batch!
and set-parameters
in next.jdbc.prepare
.next.jdbc/execute-batch!
(previously next.jdbc.prepare/execute-batch!
).assert
s in next.jdbc.sql
as more informative errors for cases that would generate SQL exceptions (from malformed SQL).:order-by
to reflect what is actually permitted.next.jdbc.connect/dbtypes
as a table of known database types and aliases, along with their class name(s), port, and other JDBC string components.1.0.1 -- 2019-07-03
with-transaction
to "require less" of the :binding
vector.with-transaction
macro.insert-multi!
performs a single, batched operation.key-map
in find-by-keys
, update!
, and delete!
to reflect that you cannot pass an empty map to these functions (and added tests to ensure the calls fail with spec errors).1.0.0 "gold" -- 2019-06-12
reify
'd objects produce a more informative string representation if they are printed (e.g., misusing plan
by not reducing it or not mapping an operation over the rows).next.jdbc.result-set/datafiable-result-set
so that various java.sql.DatabaseMetaData
methods that return result metadata information in ResultSet
s can be easily turned into a fully realized result set.1.0.0-rc1 -- 2019-06-04
next.jdbc
functions.next.jdbc.optional
with six map builders that omit NULL
columns from the row hash maps.transact
function and the with-transaction
macro (for consistency with the name of the underlying protocol).modified
variants of column name functions and builders. The lower
variants have been rewritten in terms of these new modified
variants. This adds :label-fn
and :qualifier-fn
options that mirror :column-fn
and :table-fn
for row builders.1.0.0-beta1 -- 2019-05-24
next.jdbc.specs
and documenting basic usage.reducible!
to plan
(BREAKING CHANGE!).:next.jdbc/sql-string
to :next.jdbc/sql-params
(BREAKING CHANGE!) and pass whole vector.:gen-fn
to :builder-fn
(BREAKING CHANGE!); Fix #13 by adding documentation for datafy
/nav
/:schema
; Fix #15 by automatically adding :next.jdbc/sql-string
(as of 1.0.0-alpha12: :next.jdbc/sql-params
) into the options hash map, so custom builders can depend on the SQL string.:gen-fn
(as of 1.0.0-alpha11: :builder-fn
) in execute-one!
for PreparedStatement
.Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close