Liking cljdoc? Tell your friends :D

korma.db

Functions for creating and managing database specifications.

Functions for creating and managing database specifications.
raw docstring

*current-conn*clj


*current-db*clj


_defaultclj


c3p0-enabled?clj


connection-poolclj

(connection-pool {:keys [subprotocol subname classname excess-timeout
                         idle-timeout initial-pool-size minimum-pool-size
                         maximum-pool-size test-connection-query
                         idle-connection-test-period test-connection-on-checkin
                         test-connection-on-checkout]
                  :or {maximum-pool-size 15
                       idle-timeout (* 3 60 60)
                       excess-timeout (* 30 60)
                       idle-connection-test-period 0
                       test-connection-query nil
                       test-connection-on-checkin false
                       test-connection-on-checkout false
                       initial-pool-size 3
                       minimum-pool-size 3}
                  :as spec})

Create a connection pool for the given database spec.

Create a connection pool for the given database spec.
raw docstring

create-dbclj

(create-db spec)

Create a db connection object manually instead of using defdb. This is often useful for creating connections dynamically, and probably should be followed up with:

(default-connection my-new-conn)

If the spec includes :make-pool? true makes a connection pool from the spec.

Create a db connection object manually instead of using defdb. This is often
useful for creating connections dynamically, and probably should be followed
up with:

(default-connection my-new-conn)

If the spec includes `:make-pool? true` makes a connection pool from the spec.
raw docstring

default-connectionclj

(default-connection conn)

Set the database connection that Korma should use by default when no alternative is specified.

Set the database connection that Korma should use by default when no
alternative is specified.
raw docstring

defdbcljmacro

(defdb db-name spec)

Define a database specification. The last evaluated defdb will be used by default for all queries where no database is specified by the entity.

Define a database specification. The last evaluated defdb will be used by
default for all queries where no database is specified by the entity.
raw docstring

delay-poolclj

(delay-pool spec)

Return a delay for creating a connection pool for the given spec.

Return a delay for creating a connection pool for the given spec.
raw docstring

do-queryclj

(do-query {:keys [db] :as query})

extract-optionsclj

(extract-options {:keys [naming delimiters alias-delimiter subprotocol]})

firebirdclj

(firebird {:keys [host port db make-pool?]
           :or {host "localhost" port 3050 db "" make-pool? true}
           :as opts})

Create a database specification for a FirebirdSQL database. Opts should include keys for :db, :user, :password. You can also optionally set host, port and make-pool?

Create a database specification for a FirebirdSQL database. Opts should include
keys for :db, :user, :password. You can also optionally set host, port and make-pool?
raw docstring

get-connectionclj

(get-connection db)

Get a connection from the potentially delayed connection object.

Get a connection from the potentially delayed connection object.
raw docstring

h2clj

(h2 {:keys [db make-pool?] :or {db "h2.db" make-pool? true} :as opts})

Create a database specification for a h2 database. Opts should include a key for :db which is the path to the database file.

Create a database specification for a h2 database. Opts should include a key
for :db which is the path to the database file.
raw docstring

is-rollback?clj

(is-rollback?)

Returns true if the current transaction will be rolled back

Returns true if the current transaction will be rolled back
raw docstring

msaccessclj

(msaccess {:keys [db make-pool?] :or {db "" make-pool? false} :as opts})

Create a database specification for a Microsoft Access database. Opts should include keys for :db and optionally :make-pool?.

Create a database specification for a Microsoft Access database. Opts
should include keys for :db and optionally :make-pool?.
raw docstring

mssqlclj

(mssql {:keys [user password db host port make-pool?]
        :or {user "dbuser"
             password "dbpassword"
             db ""
             host "localhost"
             port 1433
             make-pool? true}
        :as opts})

Create a database specification for a mssql database. Opts should include keys for :db, :user, and :password. You can also optionally set host and port.

Create a database specification for a mssql database. Opts should include keys
for :db, :user, and :password. You can also optionally set host and port.
raw docstring

mysqlclj

(mysql {:keys [host port db make-pool?]
        :or {host "localhost" port 3306 db "" make-pool? true}
        :as opts})

Create a database specification for a mysql database. Opts should include keys for :db, :user, and :password. You can also optionally set host and port. Delimiters are automatically set to "`".

Create a database specification for a mysql database. Opts should include keys
for :db, :user, and :password. You can also optionally set host and port.
Delimiters are automatically set to "`".
raw docstring

odbcclj

(odbc {:keys [dsn make-pool?] :or {dsn "" make-pool? true} :as opts})

Create a database specification for an ODBC DSN. Opts should include keys for :dsn and optionally :make-pool?.

Create a database specification for an ODBC DSN. Opts
should include keys for :dsn and optionally :make-pool?.
raw docstring

oracleclj

(oracle {:keys [host port make-pool?]
         :or {host "localhost" port 1521 make-pool? true}
         :as opts})

Create a database specification for an Oracle database. Opts should include keys for :user and :password. You can also optionally set host and port.

Create a database specification for an Oracle database. Opts should include keys
for :user and :password. You can also optionally set host and port.
raw docstring

postgresclj

(postgres {:keys [host port db make-pool?]
           :or {host "localhost" port 5432 db "" make-pool? true}
           :as opts})

Create a database specification for a postgres database. Opts should include keys for :db, :user, and :password. You can also optionally set host and port.

Create a database specification for a postgres database. Opts should include
keys for :db, :user, and :password. You can also optionally set host and
port.
raw docstring

resolve-newcljmacro

(resolve-new class)

rollbackclj

(rollback)

Tell this current transaction to rollback.

Tell this current transaction to rollback.
raw docstring

sqlite3clj

(sqlite3 {:keys [db make-pool?] :or {db "sqlite.db" make-pool? true} :as opts})

Create a database specification for a SQLite3 database. Opts should include a key for :db which is the path to the database file.

Create a database specification for a SQLite3 database. Opts should include a
key for :db which is the path to the database file.
raw docstring

transactioncljmacro

(transaction body)
(transaction options & body)

Execute all queries within the body in a single transaction. Optionally takes as a first argument a map to specify the :isolation and :read-only? properties of the transaction.

Execute all queries within the body in a single transaction.
Optionally takes as a first argument a map to specify the :isolation and :read-only? properties of the transaction.
raw docstring

verticaclj

(vertica {:keys [host port db make-pool?]
          :or {host "localhost" port 5433 db "" make-pool? true}
          :as opts})

Create a database specification for a vertica database. Opts should include keys for :db, :user, and :password. You can also optionally set host and port. Delimiters are automatically set to "`".

Create a database specification for a vertica database. Opts should include keys
for :db, :user, and :password. You can also optionally set host and port.
Delimiters are automatically set to "`".
raw docstring

with-dbcljmacro

(with-db db & body)

Execute all queries within the body using the given db spec

Execute all queries within the body using the given db spec
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close