Datalevin client to Datalevin server, blocking API, with a connection pool
Datalevin client to Datalevin server, blocking API, with a connection pool
(assign-role client role-key username)
Assign a role to a user.
Assign a role to a user.
(close-database client db-name)
Force close a database. Connected clients that are using it will be disconnected.
Force close a database. Connected clients that are using it will be disconnected. See [[disconnect-client]]
(create-database client db-name db-type)
Create a database. db-type
can be :datalog
or :key-value
.
db-name
will be converted to Kebab case (i.e. all lower case and
words connected with dashes).
Create a database. `db-type` can be `:datalog` or `:key-value`. `db-name` will be converted to Kebab case (i.e. all lower case and words connected with dashes).
(create-role client role-key)
Create a role. role-key
is a keyword.
Create a role. `role-key` is a keyword.
(create-user client username password)
Create a user that can login. username
will be converted to Kebab case
(i.e. all lower case and words connected with dashes).
Create a user that can login. `username` will be converted to Kebab case (i.e. all lower case and words connected with dashes).
(disconnect-client client client-id)
Force disconnect a client from the server.
Force disconnect a client from the server.
(drop-database client db-name)
Delete a database. May not be successful if currently in use.
See close-database
Delete a database. May not be successful if currently in use. See [[close-database]]
(drop-role client role-key)
Delete a role. role-key
is a keyword.
Delete a role. `role-key` is a keyword.
(grant-permission client role-key perm-act perm-obj perm-tgt)
Grant a permission to a role.
perm-act
indicates the permitted action. It can be one of
:datalevin.server/view
, :datalevin.server/alter
,
:datalevin.server/create
, or :datalevin.server/control
, with each
subsumes the former.
perm-obj
indicates the object type of the securable. It can be one of
:datalevin.server/database
, :datalevin.server/user
,
:datalevin.server/role
, or :datalevin.server/server
, where the last one
subsumes all the others.
perm-tgt
indicate the concrete securable target. It can be a database name,
a username, or a role key, depending on perm-obj
. If it is nil
, the
permission applies to all securables in that object type.
Grant a permission to a role. `perm-act` indicates the permitted action. It can be one of `:datalevin.server/view`, `:datalevin.server/alter`, `:datalevin.server/create`, or `:datalevin.server/control`, with each subsumes the former. `perm-obj` indicates the object type of the securable. It can be one of `:datalevin.server/database`, `:datalevin.server/user`, `:datalevin.server/role`, or `:datalevin.server/server`, where the last one subsumes all the others. `perm-tgt` indicate the concrete securable target. It can be a database name, a username, or a role key, depending on `perm-obj`. If it is `nil`, the permission applies to all securables in that object type.
(list-databases-in-use client)
List databases that are in use.
List databases that are in use.
(list-role-permissions client role-key)
List the permissions granted to a role.
See grant-permission
.
List the permissions granted to a role. See [[grant-permission]].
(list-user-permissions client username)
List the permissions granted to a user through the roles assigned.
List the permissions granted to a user through the roles assigned.
(list-user-roles client username)
List the roles assigned to a user.
List the roles assigned to a user.
(new-client uri-str)
(new-client uri-str
{:keys [pool-size time-out]
:or {pool-size c/default-connection-pool-size
time-out c/default-connection-timeout}})
Create a new client that maintains pooled connections to a remote Datalevin database server. This operation takes at least 0.5 seconds in order to perform a secure password hashing that defeats cracking.
Fields in the uri-str
should be properly URL encoded, e.g. user and
password need to be URL encoded if they contain special characters.
The following can be set in the optional map:
:pool-size
determines number of connections maintained in the connection
pool, default is 3.:time-out
specifies the time (milliseconds) before an exception is thrown
when obtaining an open network connection, default is 60000.Create a new client that maintains pooled connections to a remote Datalevin database server. This operation takes at least 0.5 seconds in order to perform a secure password hashing that defeats cracking. Fields in the `uri-str` should be properly URL encoded, e.g. user and password need to be URL encoded if they contain special characters. The following can be set in the optional map: * `:pool-size` determines number of connections maintained in the connection pool, default is 3. * `:time-out` specifies the time (milliseconds) before an exception is thrown when obtaining an open network connection, default is 60000.
(open-database client db-name db-type)
(open-database client db-name db-type opts)
(open-database client db-name db-type schema opts)
Open a database on server. db-type
can be "datalog", "kv",
or "engine"
Open a database on server. `db-type` can be "datalog", "kv", or "engine"
(query-system client query & arguments)
Issue arbitrary Datalog query to the system database on the server.
Note that unlike q
function, the arguments here should NOT include db,
as the server will supply it.
Issue arbitrary Datalog query to the system database on the server. Note that unlike `q` function, the arguments here should NOT include db, as the server will supply it.
(reset-password client username password)
Reset a user's password.
Reset a user's password.
(revoke-permission client role-key perm-act perm-obj perm-tgt)
Revoke a permission from a role.
See grant-permission
.
Revoke a permission from a role. See [[grant-permission]].
(show-clients client)
Show information about the currently connected clients on the server.
Show information about the currently connected clients on the server.
(withdraw-role client role-key username)
Withdraw a role from a user.
Withdraw a role from a user.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close