Liking cljdoc? Tell your friends :D

datalevin.client

Datalevin client to Datalevin server, blocking API, with a connection pool

Datalevin client to Datalevin server, blocking API, with a connection pool
raw docstring

assign-roleclj

(assign-role client role-key username)

Assign a role to a user.

Assign a role to a user. 
sourceraw docstring

close-databaseclj

(close-database client db-name)

Force close a database. Connected clients that are using it will be disconnected.

See disconnect-client

Force close a database. Connected clients that are using it
will be disconnected.

See [[disconnect-client]]
sourceraw docstring

create-databaseclj

(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).
sourceraw docstring

create-roleclj

(create-role client role-key)

Create a role. role-key is a keyword.

Create a role. `role-key` is a keyword.
sourceraw docstring

create-userclj

(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).
sourceraw docstring

disconnect-clientclj

(disconnect-client client client-id)

Force disconnect a client from the server.

Force disconnect a client from the server.
sourceraw docstring

drop-databaseclj

(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]]
sourceraw docstring

drop-roleclj

(drop-role client role-key)

Delete a role. role-key is a keyword.

Delete a role. `role-key` is a keyword.
sourceraw docstring

drop-userclj

(drop-user client username)

Delete a user.

Delete a user.
sourceraw docstring

grant-permissionclj

(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.
sourceraw docstring

list-databasesclj

(list-databases client)

List all databases.

List all databases.
sourceraw docstring

list-databases-in-useclj

(list-databases-in-use client)

List databases that are in use.

List databases that are in use.
sourceraw docstring

list-role-permissionsclj

(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]].
sourceraw docstring

list-rolesclj

(list-roles client)

List all roles.

List all roles.
sourceraw docstring

list-user-permissionsclj

(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.
sourceraw docstring

list-user-rolesclj

(list-user-roles client username)

List the roles assigned to a user.

List the roles assigned to a user. 
sourceraw docstring

list-usersclj

(list-users client)

List all users.

List all users.
sourceraw docstring

new-clientclj

(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.
sourceraw docstring

open-databaseclj

(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"
sourceraw docstring

query-systemclj

(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.
sourceraw docstring

reset-passwordclj

(reset-password client username password)

Reset a user's password.

Reset a user's password.
sourceraw docstring

revoke-permissionclj

(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]].
sourceraw docstring

show-clientsclj

(show-clients client)

Show information about the currently connected clients on the server.

Show information about the currently connected clients on the server.
sourceraw docstring

withdraw-roleclj

(withdraw-role client role-key username)

Withdraw a role from a user.

Withdraw a role from a user. 
sourceraw docstring

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

× close