(connect! pool-spec)
attempts to create a new connection and set it as the value of the conn atom, does nothing if conn atom is already populated
attempts to create a new connection and set it as the value of the conn atom, does nothing if conn atom is already populated
(disconnect! conn)
checks if there's a connection and closes it resets the conn to nil
checks if there's a connection and closes it resets the conn to nil
(make-config {:keys [jdbc-url adapter datasource datasource-classname]
:as pool-spec})
(query connection-map query-key)
(query connection-map query-key params)
(query conn connection-map query-key params & opts)
runs a database query and returns the result conn - database connection queries - a map of queries id - keyword indicating the name of the query args - arguments that will be passed to the query
runs a database query and returns the result conn - database connection queries - a map of queries id - keyword indicating the name of the query args - arguments that will be passed to the query
(reconnect! conn pool-spec)
calls disconnect! to ensure the connection is closed then calls connect! to establish a new connection
calls disconnect! to ensure the connection is closed then calls connect! to establish a new connection
(with-transaction [dbsym & opts] & body)
Runs the body in a transaction where t-conn is the name of the transaction connection. The body will be evaluated within a binding where conn is set to the transactional connection. The isolation level and readonly status of the transaction may also be specified. (with-transaction [conn {:isolation level :read-only? true}] ... t-conn ...) See next.jdbc/transact for more details on the semantics of the :isolation and :read-only options.
Runs the body in a transaction where t-conn is the name of the transaction connection. The body will be evaluated within a binding where conn is set to the transactional connection. The isolation level and readonly status of the transaction may also be specified. (with-transaction [conn {:isolation level :read-only? true}] ... t-conn ...) See next.jdbc/transact for more details on the semantics of the :isolation and :read-only options.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close