-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible improvements #117
Comments
Macros for collections like |
Thanks Petar for your feedback, please keep them coming. |
It would be nice if the |
Some functions' arguments have improper names, where For example pub async fn execute_udf(
&self,
policy: &WritePolicy,
key: &Key,
udf_name: &str,
function_name: &str,
args: Option<&[Value]>,
) Inside the body of this function, |
To expand on this, the macro can also generate a rust function with the same name as the client
.execute_udf(
&WritePolicy::default(),
&key,
"map_merge",
"map_merge",
Some(&[as_val!(2)]),
)
.await; you will call it like map_merge(client, &WritePolicy::default(), as_val!(2)]).await Which will push more errors into compile time, like incorrect arguments. |
This enum was defined with the idea that there would be more than 1 language and possible additions in the future. /// User-defined function (UDF) language
#[derive(Debug)]
pub enum UDFLang {
/// Lua embedded programming language.
Lua,
} |
Hello, i've been trying out the client and i have some points that could possibly be improved.
I was using a "hello world" project that didn't have logging or anything like that setup.
Therefore, i received the following error
This error obviously doesn't say much.
I had to go read the source code to see that some of the errors are not returned, but simply logged in
debug!
statementsAnd the reason i encountered this error is because of the suboptimal design of the
ClientPolicy
data structure.It has the field
pub user_password: Option<(String, String)>,
public but will only work via the setter methodset_user_password
, because it is being hashed there.Rust has a very powerful type system and we don't need to rely on documentation to suggest correct usage.
We can enforce correct usage.
I also don't see a reason of preemptively hashing the password.
I would do it lazily, when the request is actually sent.
When i followed the tutorial and setup a EKS cluster, the default user was
admin
.However, as it seems,
admin
didn't havewrite
permissions, for some reason.Which comes back to the fact that errors are not being returned and the client can't model his/her code based on them.
The text was updated successfully, but these errors were encountered: