Functions for creating and managing database specifications.
Functions for creating and managing database specifications.
(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.
(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.
(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.
(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.
(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.
(do-query {:keys [db] :as query})
(extract-options {:keys [naming delimiters alias-delimiter subprotocol]})
(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?
(get-connection db)
Get a connection from the potentially delayed connection object.
Get a connection from the potentially delayed connection object.
(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.
(is-rollback?)
Returns true if the current transaction will be rolled back
Returns true if the current transaction will be rolled back
(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?.
(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.
(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 "`".
(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?.
(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.
(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.
(resolve-new class)
(rollback)
Tell this current transaction to rollback.
Tell this current transaction to rollback.
(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.
(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.
(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 "`".
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close