aerospike / aerospike-client-rust

Rust client for the Aerospike database
https://www.aerospike.com/
Other
82 stars 26 forks source link

how to access client's `Cluster`? #134

Open databasedav opened 1 year ago

databasedav commented 1 year ago

i need this to run admin commands, i was looking through the code and couldn't find a way, can we simply make Client.cluster pub?

khaf commented 1 year ago

What API do you need to call?

databasedav commented 1 year ago

@khaf create_user, grant_roles, and ideally create_role as well but that has not been implemented yet for the rust client (#137), my goal is to do all database management stuff programmatically for the managed service (which recently went live for me), right now that involves creating set-limited roles, users, and indices, for now i've manually created all roles with asadm but u can imagine the convenience of performing all migrations programmatically with this client as roles/users/indices need to be created/removed

databasedav commented 1 year ago

also create_user doesn't seem to be working for me, e.g. hitting an aerospike-ee container locally e.g.

AdminCommand::create_user(
    &aerospike_client.cluster,
    "tester",
    "testpassword",
    &["truncate"],
)
.await
.map_err(|error| anyhow!(error.to_string()))?;

gives me Server error: Invalid field

seeing the same hitting the managed service as well

khaf commented 1 year ago

I see. I don't know why those API are not exposed through the client itself. I will take care of these issues in the next few days.