squee.impl.protocols

IConnection

protocol

Internal, do not extend. Only extenders should be java.sql.Connection
and things in the transaction namespace.

members

get-connection

(get-connection _)
Returns the open underlying connection.

IDataSource

protocol

members

open-connection

(open-connection _)
Must return a java.sql.Connection

ISQLParameter

protocol

Protocol for setting SQL parameters in statement objects, which
can convert from Clojure values. The default implementation just
delegates the conversion to ISQLValue's sql-value conversion and
uses .setObject on the parameter. It can be extended to use other
methods of PreparedStatement to convert and set parameter values.

members

set-parameter

(set-parameter val stmt ix)
Convert a Clojure value into a SQL value and store it as the ix'th
parameter in the given SQL statement object.

ISQLValue

protocol

Protocol for creating SQL values from Clojure values. Default
implementations (for Object and nil) just return the argument,
but it can be extended to provide custom behavior to support
exotic types supported by different databases.

members

sql-value

(sql-value val)
Convert a Clojure value into a SQL value.

ITransaction

protocol

members

commit!

(commit! _)

rollback!

(rollback! _)

ITransactionFactory

protocol

members

begin!

(begin! _ opts)
Starts a transaction, returning something that encompasses a connection and transaction

RowGenerator

protocol

members

complete-row

(complete-row _ row)
similar to an arity-1 reducing function completer

make-row

(make-row _)
Creates a gestational row

with-field

(with-field _ row name val)
Adds the kv pair to the row, returning a new row