Changes in 0.7.12
ISQLValue
, ISQLParameter
, and IResultSetReadColumn
extensible via metadata.Changes in 0.7.11
Changes in 0.7.10
lower-case
function to avoid problems in certain locales (e.g., Turkish). A similar issue has been fixed recently in both HoneySQL and next.jdbc
.db-spec
options that are passed to the JDBC connection manager as properties JDBC-178.create-table-ddl
column specs to allow numbers (as well as keywords and strings) JDBC-177.Changes in 0.7.9
datafy
/nav
(in clojure.java.jdbc.datafy
namespace). This includes a convention-based approach to foreign keys with some assistance from a :schema
option. This is subject to change and is provided mostly for informational purposes, as an example of the new functionality in Clojure 1.10. This includes a fix for the conventions from JDBC-175.insert-multi!
for some drivers JDBC-174.dbtype
can be oracle:sid
which maps to oracle:thin
and uses :
as the separator before the dbname
value) JDBC-173.Changes in 0.7.8
with-db-connection
and with-db-metadata
to nest JDBC-171.Changes in 0.7.7
:as-arrays?
, :result-set-fn
, and :row-fn
in operations that return generated keys as a result set (execute!
, insert!
, and insert-multi!
) JDBC-169.get-connection
provides much better feedback if you accidentally call a function that expects a db-spec
but pass a java.sql.Connection
object instead (which is only required for prepare-statement
).Changes in 0.7.6
execute!
now supports :return-keys
as a vector of column names, rather than just a simple Boolean value, for drivers that support that JDBC-166.:dbtype "h2:mem"
).db-spec
being a java.net.URI
object.add-connection
handling of string db-spec
(becomes :connection-uri
, not :connection-string
).with-db-*
functions, to support options in the binding form JDBC-165.db-spec
test databases.deps.edn
(from Leiningen) as an example of multi-version testing without a "build tool".Changes in 0.7.5
:return-keys
in execute!
and :multi?
in db-do-prepared-return-keys
JDBC-163.Changes in 0.7.4
java.jdbc
documentation JDBC-160.:keywordize?
and :connection-uri
changes from 0.7.2 and 0.7.3 releases.query
and reducible-query
.:raw?
result set handling in reducible-query
.modify-connection
is more robust in the face of null
connections and bad option values.Changes in 0.7.3
:keywordize?
option alongside :identifiers
that defaults to true
but can be set to false
to opt-out of converting identifiers to keywords (so column names etc will only be processed by the function passed as :identifiers
) JDBC-159.ex-info
. Previously the rollback exception obscured the transaction exception JDBC-158.Changes in 0.7.2
connection-uri
was incorrectly spec'd as a java.net.URI
but should be string?
JDBC-156.:user
and :password
to be passed with :connection-uri
, so credentials can be omitted from the connection string.get-connection
to show where :user
and :password
can be passed.Changes in 0.7.1
Changes in 0.7.0
:conditional?
option for create-table-ddl
and drop-table-ddl
to provide for existence check (or a function to manipulate the generated DDL).1521
, support :dbtype "oracle"
-- as "oracle:thin"
-- and :dbtype "oracle:oci"
, with @
instead of //
before host).Changes in 0.7.0-beta5
get-connection
now accepts an opts
map with :auto-commit?
and :read-only?
options. If present, the appropriate methods will be called on the connection obtained. These options are valid in any function call that may call get-connection
under the hood. This should allow for streaming results in a query for most databases JDBC-153.prepared-statement
to avoid silently ignoring invalid combinations of :concurrency
, :cursors
, :result-type
, and :return-keys
.Changes in 0.7.0-beta4
opts
are now correctly passed from reducible-query
to db-query-with-resultset
.::query-options
spec to make it clear that ::prepare-options
are also acceptable there.Changes in 0.7.0-beta3
reducible-result-set
JDBC-152.Changes in 0.7.0-beta2
clojure.java.jdbc
now requires Clojure 1.7 or later!clojure.java.jdbc.spec
namespace (requires clojure.spec.alpha
).reducible-query
and reducible-result-set
use IReduce
and correctly support the no-init
arity of reduce
by using the first row of the ResultSet
, if present, as the (missing) init
value, and only calling f
with no arguments if the ResultSet
is empty. The init
arity of reduce
only ever calls f
with two arguments.Changes in 0.7.0-beta1
clojure.spec.alpha
.reducible-query
accepts a db-spec
and a SQL/parameters vector and returns a reducible (IReduce
on Clojure 1.7 or later; CollReduce
on Clojure 1.5/1.6): when reduced, it runs the query, obtains a reducible result set, and then reduces that. A reducible query will run the query each time it is reduced. The helper function reducible-result-set
is public: it accepts a ResultSet
and produces a reducible that offers a single pass reduce over the rows. Both functions honor reduced
values to short-circuit the process JDBC-99.Changes in 0.7.0-alpha3
classname
is now accepted with dbtype
/ dbname
so you can easily specify a JDBC driver class name for a database type that is not known JDBC-151.redshift
has been added as a dbtype
with com.amazon.redshift.jdbc.Driver
as the driver name.Changes in 0.7.0-alpha2
pgsql
and the Impossibl PostgresSQL 'NG' driver are now supported (note that :max-rows
does not work with this driver!); also, providing unknown dbtype
or subprotocol
in a db-spec
should now throw a better exception JDBC-150.quoted
now accepts keywords for database / dialect (:ansi
(including PostgresSQL), :mysql
, :oracle
, :sqlserver
-- these match the keywords used in HoneySQL which is the recommended third party SQL DSL for java.jdbc) JDBC-149.get-connection
clauses to make it easier to combine keys in a db-spec
JDBC-148.DriverManager
before classForName
call on drivers to avoid potential race condition on initialization JDBC-145.Changes in 0.7.0-alpha1 -- potentially breaking changes
as-sql-name
and quoted
have changed slightly: the former no longer has the curried (single argument) version, and the latter no longer has the two argument version. This change came out of a discussion on Slack which indicated curried functions are non-idiomatic. If you relied on the curried version of as-sql-name
, you will not need to use partial
. If you relied on the two argument version of quoted
, you will need to add an extra ( )
for the one argument call. I'd be fairly surprised if anyone is using as-sql-name
at all since it is really an implementation detail. I'd also be surprised if anyone was using the two argument version of quoted
since the natural usage is :entities (quoted [\[ \]])
to create a naming strategy (that provides SQL entity quoting).insert-multi!
with a sequence of row maps may be substantially slower than with a sequence of row value vectors (the former performs an insert for each row, the latter performs a single insert for all the data together) JDBC-147.insert!
and update!
JDBC-144.get-isolation-level
to return the current transaction's isolation level, if any JDBC-141.read-columns
option to allow more flexible customization of reading column values from a result set (particularly in a multi-database application). Also expands set-parameters
support to options (previously it was just part of the db-spec) JDBC-137.clojure.spec
coverage to almost the whole library API.Changes in 0.6.2-alpha3
:qualifier
and existing :identifiers
functionality JDBC-140.:dbtype
is the easiest / preferred way to write db-spec
maps JDBC-139.Changes in 0.6.2-alpha2
clojure.spec
support to work properly with Clojure 1.9.0 Alpha 10.Changes in 0.6.2-alpha1
clojure.spec
via the new clojure.java.jdbc.spec
namespace. Requires Clojure 1.9.0 Alpha 8 (or later).db-spec
itself JDBC-136.query
(and by extension find-by-keys
and get-by-id
) now support :explain?
and :explain-fn
options to help support basic performance analysis JDBC-135.insert!
and insert-multi!
now respect :identifiers
and :qualifier
because inserting rows on PostgreSQL returns full rows, not just the newly inserted keys JDBC-134.:identifiers
option, you can now use :qualifier
to specify a namespace qualifier (string) to be used when constructing keywords from SQL column names JDBC-133.Changes in 0.6.1
insert!
and insert-multi!
now default :transaction?
to true
(as they should have done in 0.6.0!) JDBC-128. These two functions also have improved docstrings to clarify the difference in behavior between inserting rows as maps compared to inserting rows as a series of column values.Changes in 0.6.0
find-by-keys
now correctly handles nil
values JDBC-126.find-by-keys
calls seq
on :order-by
to treat []
as no ORDER BY
clause.Changes in 0.6.0-rc2
db-query-with-resultset
now accepts an options map and passes it to prepare-statement
JDBC-125.
prepare-statement
options map as the first element of the [sql & params]
vector is no longer supported and will throw an IllegalArgumentException
. It was always very poorly documented and almost never used, as far as I can tell.db-query-with-resultset
no longer requires the sql-params
argument to be a vector: a sequence is acceptable. This is in line with other functions that accept a sequence.db-query-with-resultset
now accepts a bare SQL string or PreparedStatement
as the sql-params
argument, when there are no parameters needed. This is in line with other functions that accept SQL or a PreparedStatement
.query
's options map now is passed to db-query-with-resultset
and thus can contain options to be used to construct the PreparedStatement
JDBC-125.find-by-keys
now accepts an :order-by
option that specifies a sequence of orderings; an ordering is either a column (to sort ascending) or a map from column name to direct (:asc
or :desc
).Changes in 0.6.0-rc1
get-by-id
and find-by-keys
convenience functions (these were easy to add after the API changes in 0.6.0 and we rely very heavily on them at World Singles so putting them in the core for everyone seemed reasonable).Changes in 0.6.0-alpha2
db-do-prepared*
which should have been removed in Alpha 1.insert-multi!
argument validation exception JDBC-123.Changes in 0.6.0-alpha1
db-transaction
(deprecated in version 0.3.0) has been removedjava.jdbc.deprecated
namespace has been removedChanges in 0.5.8
db-do-commands
now expects multiple commands to be be wrapped in a vector JDBC-122. The single command form is unchanged (but may be wrapped in a vector). Calling db-do-commands
with multiple commands (not wrapped in a single vector) will produce a "DEPRECATED" warning printed to the console.db-do-prepared
and db-do-prepared-return-keys
now expect to receive a db-spec
, an optional transaction?
boolean, a sql-params
argument, and an optional options map. sql-params
is a vector containing a SQL string or PreparedStatement
followed by parameters -- like other APIs in this library. In addition, like the :multi? true
version of execute!
, db-do-prepared
can accept a vector that has parameter groups: multiple vectors containing groups of parameter values JDBC-122. Calling db-do-prepared
with unrolled arguments -- the SQL string / statement followed by parameter groups -- is deprecated and will produce "DEPRECATED" warnings printed to the console.Changes in 0.5.7
(insert! db table [:col] ["val"] {})
syntax, introduced in 0.5.6, threw an exception JDBC-121.Changes in 0.5.6
create-table-ddl
now expects the column specs to be wrapped in a single vector and no longer needs the :options
delimiter to specify the options map JDBC-120. If column specs are not wrapped in a vector, you will get a "DEPRECATED" warning printed to the console.insert!
now supports only single row insertion; multi-row insertion is deprecated. insert-multi!
has been added for multi-row insertion. :options
is no longer needed as a delimiter for the options map JDBC-119. If insert!
is called with multiple rows, or :options
is specified, you will get a "DEPRECATED" warning printed to the console.Changes in 0.5.5
Changes in 0.5.0
Changes in 0.4.2
.prepareStatement
JDBC-112 - Michael Blume.metadata-query
macro to make metadata query / results easier to work with for JDBC-107.prepare-statement
:return-keys
may now be a vector of (auto-generated) column names to return, in addition to just being truthy or falsey. This allows keys to be returned for more databases. JDBC-104.Changes in 0.4.0 / 0.4.1
db-do-prepared
now allows transaction?
to be omitted when a PreparedStatement
is passed as the second argument JDBC-111 - Stefan Kamphausen.Changes in 0.3.7
project.clj
and re-test.count
calls in insert-sql
JDBC-108 - Earl St Sauver.Changes in 0.3.6
:cursors
, :concurrency
, :result-type
arguments to prepare-statement
JDBC-102.:as-arrays? :cols-as-is
to omit column name uniqueness when returning result sets as arrrays JDBC-101.:timeout
argument to prepare-statement
JDBC-100.Changes in 0.3.5
Changes in 0.3.4
Changes in 0.3.3
Changes in 0.3.2
Changes in 0.3.1 (broken)
Changes in 0.3.0
Changes in 0.3.0-rc1
Changes in 0.3.0-beta2
clojure.java.jdbc.deprecated
to help streamline the API for 0.3.0 and clean up the documentation.Changes in 0.3.0-beta1
db-with-query-results*
and processes a raw ResultSet object JDBC-63.Changes in 0.3.0-alpha5
DDL now supports entities naming strategy JDBC-53.
Attempt to address potential memory leaks due to closures - see Christophe Grand's blog post on Macros, closures and unexpected object retention.
Documentation has moved to Using java.jdbc on Clojure-Doc.org
Added Leiningen support for easier development/testing (Maven is still the primary build tool).
Added create-index / drop-index DDL JDBC-62 - moquist
Make transaction? boolean optional in various db-do-*
functions
Create clojure.java.jdbc.ddl namespace
Add create-table, drop-table, create-index and drop-index
Deprecate create-table, create-table-ddl and drop-table in main namespace
Update README to clarify PostgreSQL instructions.
Fix test suite for PostgreSQL JDBC-59
Improve hooks for Oracle data type handling JDBC-57
Fix reflection warnings JDBC-55
DDL now supports entities naming strategy JDBC-53.
Attempt to address potential memory leaks due to closures - see Christophe Grand's blog post on Macros, closures and unexpected object retention.
Documentation has moved to Using java.jdbc on Clojure-Doc.org
Added Leiningen support for easier development/testing (Maven is still the primary build tool).
Added create-index / drop-index DDL JDBC-62 - moquist
Make transaction? boolean optional in various db-do-*
functions
Create clojure.java.jdbc.ddl namespace
Update README to clarify PostgreSQL instructions.
Fix test suite for PostgreSQL JDBC-59
Improve hooks for Oracle data type handling JDBC-57
Fix reflection warnings JDBC-55
Changes in 0.3.0-alpha4
Changes in 0.3.0-alpha3
Changes in 0.3.0-alpha2
Changes in 0.3.0-alpha1
Major overhaul of the API and deprecation of most of the old API!
(db-transaction [t-con db-spec]
(query t-con (select * :user (where {:id 42}))))
Changes in 0.2.3:
Changes in 0.2.2:
Changes in 0.2.1:
Changes in 0.2.0:
Changes in 0.1.4:
Changes in 0.1.3:
Changes in 0.1.2:
Changes in 0.1.1:
Changes in 0.1.0:
Changes in 0.0.7:
Changes in 0.0.6:
Changes in 0.0.5:
Changes in 0.0.4:
do-prepared*
, separating out return keys logic and parameter setting logic
Changes in 0.0.3:
Changes in 0.0.2:
Changes in 0.0.1 (compared to clojure.contrib.sql):
*out*
Can you improve this documentation? These fine people already did:
Sean Corfield & Alex MillerEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close