Liking cljdoc? Tell your friends :D

szew.h2

H2 database helper functions.

H2 database helper functions.
raw docstring

adjust!clj

(adjust! a-name update-fn)

Run given update-fn on a-name in connections. Advanced use.

Run given update-fn on a-name in connections. Advanced use.
raw docstring

bulk-insert-mode!clj

(bulk-insert-mode! conn)

Set H2 into bulk insert mode recommended in docs.

Set H2 into bulk insert mode recommended in docs.
raw docstring

columnlist?clj

(columnlist? conn)

Are we being asked for columnlist spec?

This will return true if inside a function being used as stored procedure by H2 engine. It means that we are requested to return java.sql.ResultSet, like org.h2.tools.SimpleResultSet (for queries) or Java type mapped by H2 for functions.

Are we being asked for columnlist spec?

This will return true if inside a function being used as stored procedure
by H2 engine. It means that we are requested to return java.sql.ResultSet,
like org.h2.tools.SimpleResultSet (for queries) or Java type mapped by H2
for functions.
raw docstring

conn!clj

(conn!)
(conn! a-name)

Select named connection or :default. Throws ex-info if no such connection.

Select named connection or :default. Throws ex-info if no such connection.
raw docstring

connectionsclj

Database connection storage. Map of name: (delay conn)

Database connection storage. Map of name: (delay conn)
raw docstring

copy!clj

(copy! source target compression?)
(copy! source target dump-file compression?)

Will dump! source, raze! target, pump! target.

If dump-file not given uses temporary file and deletes it afterwards.

Will dump! source, raze! target, pump! target.

If dump-file not given uses temporary file and deletes it afterwards.
raw docstring

de-clobclj

(de-clob a-map)
(de-clob a-map touch-keys)

CLOB to String conversion in a-map returned from the database.

Warning: database connection must be open -- run in transaction.

CLOB to String conversion in a-map returned from the database.

Warning: database connection must be open -- run in transaction.
raw docstring

defaultsclj

Settings used as base for user spec.

Settings used as base for user spec.
raw docstring

dispose!clj

(dispose!)
(dispose! a-name)
(dispose! a-name finalizer)

Remove named connection. Finalizer is a callable for side-effects.

Remove named connection. Finalizer is a callable for side-effects.
raw docstring

dump!clj

(dump! conn dump-file compression?)

Exports database into a SQL file (server side).

Exports database into a SQL file (server side).
raw docstring

in-memory!clj

(in-memory! path)
(in-memory! path a-name)

Create a database spec for in-memory, JVM runtime persistent database.

Create a database spec for in-memory, JVM runtime persistent database.
raw docstring

local!clj

(local! path)
(local! path a-name)

Create a database spec for locally stored database.

Create a database spec for locally stored database.
raw docstring

make!clj

(make! spec-or-pool)
(make! spec-or-pool a-name)

Create pool entry using given spec. Name defaults to :default.

If spec-or-pool is nil, then this pool is released from storage. Instead of that you should probably use dispose!

If spec-or-pool is a Delay, then it's stored directly and returned. Otherwise it's packed into a Delay, stored and returend.

Create pool entry using given spec. Name defaults to :default.

If spec-or-pool is nil, then this pool is released from storage. Instead
of that you should probably use dispose!

If spec-or-pool is a Delay, then it's stored directly and returned. Otherwise
it's packed into a Delay, stored and returend.
raw docstring

pump!clj

(pump! conn dump-file compression?)

Imports database from SQL file (server side).

Imports database from SQL file (server side).
raw docstring

raze!clj

(raze! conn)

Drops all objects and, if no connections are open, deletes database files.

Usually in embedded mode executing this removed the database files.

Drops all objects and, if no connections are open, deletes database files.

Usually in embedded mode executing this removed the database files.
raw docstring

retrieval-mode!clj

(retrieval-mode! conn)

Set H2 into settings closer to defaults (logging etc.).

Set H2 into settings closer to defaults (logging etc.).
raw docstring

shutdown!clj

(shutdown! conn)

Executes SHUTDOWN in connections.

Executes SHUTDOWN in connections.
raw docstring

specclj

(spec path)
(spec path opts)

Create H2 spec for given path (required argument).

Store depends on method parameter of opts:

  • :raw sets :subname to given path verbose (best of luck!)
  • :tcp uses server, port and path for :subname
  • :mem sets database to in-memory storage, JVM runtime persistent
  • :nio-mem-fs is the new in-memory storage, JVM runtime persistent
  • :nio-mem-lzf for new in-memory compressing storage, JVM runtime persistent
  • :raf sets database to embedded, RandomAccessFile local storage
  • :default or anything else means local embedded (nio) file storage.

Other opts are :user, :password, :server & :port. Self explanatory.

For split filesystem use :split? flag and (2 ** :part) bytes for size.

:flags should be a map of {String String}, like {COMPRESS TRUE}, it will overwrite flags set by default so YMMV.

All in-memory stores are opened with DB_CLOSE_DELAY=-1, which means they will be available until JVM shuts down. You can close them with SHUTDOWN command.

Create H2 spec for given path (required argument).

Store depends on method parameter of opts:

* :raw sets :subname to given path verbose (best of luck!)
* :tcp uses server, port and path for :subname
* :mem sets database to in-memory storage, JVM runtime persistent
* :nio-mem-fs is the new in-memory storage, JVM runtime persistent
* :nio-mem-lzf for new in-memory compressing storage, JVM runtime persistent
* :raf sets database to embedded, RandomAccessFile local storage
* :default or anything else means local embedded (nio) file storage.

Other opts are :user, :password, :server & :port. Self explanatory.

For split filesystem use :split? flag and (2 ** :part) bytes for size.

:flags should be a map of {String String}, like {COMPRESS TRUE}, it will
overwrite flags set by default so YMMV.

All in-memory stores are opened with DB_CLOSE_DELAY=-1, which means they will
be available until JVM shuts down. You can close them with SHUTDOWN command.
raw docstring

spec->datasourceclj

(spec->datasource a-spec)

Eats spec, returns {:datasource org.h2.jdbcx.JdbcDataSource}.

Requires :subname, :user and :password.

Eats spec, returns {:datasource org.h2.jdbcx.JdbcDataSource}.

Requires :subname, :user and :password.
raw docstring

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

× close