Users, over the unary half of the protocol.
Mirrors TypeDB.User. list/2, get/3 and current/2 return names rather
than richer records: the protocol's User message carries only a name and an
optional password, and the password is never populated on the way out.
Summary
Functions
Creates a user.
Creates a user, raising on failure.
The user this connection signed in as.
The user this connection signed in as, raising on failure.
Deletes a user.
Deletes a user, raising on failure.
Whether username exists.
A username, or an error when the user does not exist.
A username, raising when the user does not exist.
Every user on the server.
Every user on the server, raising on failure.
Sets a user's password.
Sets a user's password, raising on failure.
Functions
@spec create(TypeDB.GRPC.Connection.t(), String.t(), String.t(), keyword()) :: :ok | {:error, TypeDB.Error.t()}
Creates a user.
Creates a user, raising on failure.
@spec current( TypeDB.GRPC.Connection.t(), keyword() ) :: {:ok, String.t()} | {:error, TypeDB.Error.t()}
The user this connection signed in as.
Rust's users().get_current(), and the same implementation: there is no RPC
for it, so the name comes from the connection's own credentials and is then
looked up — which means it also answers "does the account I am using still
exist".
A connection configured with a pre-issued :token has no username to look up,
and says so rather than guessing.
The user this connection signed in as, raising on failure.
@spec delete(TypeDB.GRPC.Connection.t(), String.t(), keyword()) :: :ok | {:error, TypeDB.Error.t()}
Deletes a user.
Deletes a user, raising on failure.
@spec exists?(TypeDB.GRPC.Connection.t(), String.t(), keyword()) :: boolean()
Whether username exists.
Raises TypeDB.Error for anything but a clean answer — the same contract as
TypeDB.User.exists?/3 and TypeDB.GRPC.Database.exists?/3. This used to
return {:ok, boolean()}, which agreed with neither.
@spec get(TypeDB.GRPC.Connection.t(), String.t(), keyword()) :: {:ok, String.t()} | {:error, TypeDB.Error.t()}
A username, or an error when the user does not exist.
The same contract as TypeDB.User.get/3: the answer to "is this user there"
that can also say "I could not ask", which exists?/3 cannot.
A username, raising when the user does not exist.
@spec list( TypeDB.GRPC.Connection.t(), keyword() ) :: {:ok, [String.t()]} | {:error, TypeDB.Error.t()}
Every user on the server.
Every user on the server, raising on failure.
@spec set_password(TypeDB.GRPC.Connection.t(), String.t(), String.t(), keyword()) :: :ok | {:error, TypeDB.Error.t()}
Sets a user's password.
Sets a user's password, raising on failure.