Clojure.jdbc Api Documentation

Version: 0.9.0

jdbc.proto

IConnection

protocol

Represents a connection like object that wraps a raw jdbc connection with some other data.

members

connection

(connection _)

Create or obtain existing connection

IDatabaseMetadata

protocol

Allows uniform database metadata extraction.

members

get-database-metadata

(get-database-metadata _)

Get metadata instance.

IExecute

protocol

members

execute

(execute q conn opts)

Execute a query and return a number of rows affected.

IFetch

protocol

members

fetch

(fetch q conn opts)

Fetch eagerly results executing query.

IPreparedStatement

protocol

Responsible of building prepared statements.

members

prepared-statement

(prepared-statement _ connection options)

Create a prepared statement.

ISQLResultSetReadColumn

protocol

Protocol that exposes uniform way to convert values obtained from result set to user types. Default implementation available for Object, Boolean, and nil.

members

from-sql-type

(from-sql-type _ conn metadata index)

Convert sql type to user type.

ISQLType

protocol

Protocol that exposes uniform way for convert user types to sql/jdbc compatible types and uniform set parameters to prepared statement instance. Default implementation available for Object and nil values.

members

as-sql-type

(as-sql-type _ conn)

Convert user type to sql type.

set-stmt-parameter!

(set-stmt-parameter! this conn stmt index)

Set value to statement.

ITransactionStrategy

protocol

members

begin!

(begin! _ conn opts)

Starts a transaction and return a connection instance.

commit!

(commit! _ conn opts)

Commits a transaction. Returns nil.

rollback!

(rollback! _ conn opts)

Rollbacks a transaction. Returns nil.