Comments (6)
It would be nice if the UDF
s were not just strings but went through a macro that enforced the aerospike rules for Lua
.
It would bring runtime errors into compile time.
from aerospike-client-rust.
Macros for collections like as_list
and as_map
do not create the collections with the known length.
This results in multiple unnecessary allocations.
from aerospike-client-rust.
Thanks Petar for your feedback, please keep them coming.
from aerospike-client-rust.
Some functions' arguments have improper names, where bin: &str
should actually be bin_name: &str
or udf_name: &str
where it should be module: &str
or something like that. Naming is not super important but it can be confusing in the beginning, when you are trying to figure out how this client works.
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, udf_name
is actually passed onto as package_name
.
from aerospike-client-rust.
It would be nice if the
UDF
s were not just strings but went through a macro that enforced the aerospike rules forLua
. It would bring runtime errors into compile time.
To expand on this, the macro can also generate a rust function with the same name as the Lua
function.
So instead of calling it like
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.
from aerospike-client-rust.
This enum was defined with the idea that there would be more than 1 language and possible additions in the future.
However, with this definition, adding another variant is a breaking change.
It is not clear how big of a problem that is, but still.
Adding #[non_exhaustive]
would be good.
/// User-defined function (UDF) language
#[derive(Debug)]
pub enum UDFLang {
/// Lua embedded programming language.
Lua,
}
from aerospike-client-rust.
Related Issues (20)
- FilterExpression in Query policy HOT 6
- migrate `MapWriteMode` to `MapWriteFlags`
- `Parameter error` when filtering on large i64 values HOT 5
- New Features
- Issue with Float serialization for Values HOT 1
- WaitGroup explicitly poisoned on batch_get
- Aerospike Version 6 Functionality HOT 5
- Implement serde::Serialize and serde::Deserialize for aerospike::Value and aerospike::Record HOT 1
- Implement std::convert::TryFrom<aerospike::Value> for each variant HOT 1
- support bool data type HOT 5
- `impl Stream` for `RecordSet`
- add missing policy and option fields to query and scan
- Is this still supported? HOT 1
- make error type compatible with `anyhow::Error` HOT 6
- Transaction commit and rollback HOT 1
- derive `Clone` for `Client` HOT 2
- how to access client's `Cluster`? HOT 4
- add missing role/privilege api's to `AdminCommand`
- Batch Operate HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aerospike-client-rust.