Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crate-type = ["cdylib", "rlib"]
pyo3 = { version = "0.29", default-features = false }
pyo3-async-runtimes = { version = "0.29", features = ["tokio-runtime"] }
tokio = "1.40"
aerospike-core = { git = "https://github.com/aerospike/aerospike-client-rust", branch = "v3", package = "aerospike-core", features = ["rt-tokio"] }
aerospike-core = { git = "https://github.com/aerospike/aerospike-client-rust", rev = "8af1ae70c29a84e4bc27078d77010aaee0a3e9dd", features = ["rt-tokio"] }
hex = "0.4"
ordered-float = { version = "3", default-features = false }
pyo3-stub-gen = "0.23"
Expand Down
13 changes: 13 additions & 0 deletions python/aerospike_async/_aerospike_async_native.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,11 @@ class FilterExpression:
Filter expression, which can be applied to most commands, to control which records are
affected by the command.
"""
SERVER_COMPILED_AEL_EXPRESSION_OP: builtins.int = 128
r"""
First element of the server-compiled AEL MessagePack array (`[128, "<dsl>"]`).
Matches the Java fluent client's ``Expression.SERVER_COMPILED_AEL_EXPRESSION_OP``.
"""
@staticmethod
def key(exp_type: _aerospike_async_native.ExpType) -> _aerospike_async_native.FilterExpression:
r"""
Expand Down Expand Up @@ -2254,6 +2259,14 @@ class FilterExpression:
Create an expression from a base64-encoded expression string.
"""
@staticmethod
def from_server_compiled_ael(ael:builtins.str) -> FilterExpression:
r"""
Build a filter expression whose wire form is ``[128, "<ael>"]`` (MessagePack), so the
server (8.1.3+) parses and compiles the Aerospike Expression Language string.

See also ``SERVER_COMPILED_AEL_EXPRESSION_OP``.
"""
@staticmethod
def unknown() -> _aerospike_async_native.FilterExpression:
r"""
Create unknown value. Used to intentionally fail an expression.
Expand Down
8 changes: 4 additions & 4 deletions src/cdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ use crate::record::PythonValue;
////////////////////////////////////////////////////////////////////////////////////////////

#[gen_stub_pyclass(module = "_aerospike_async_native")]
#[pyclass(from_py_object,
#[pyclass(from_py_object,
name = "BitPolicy",
module = "_aerospike_async_native",
subclass,
Expand Down Expand Up @@ -1211,7 +1211,7 @@ use crate::record::PythonValue;
////////////////////////////////////////////////////////////////////////////////////////////

#[gen_stub_pyclass(module = "_aerospike_async_native")]
#[pyclass(from_py_object,
#[pyclass(from_py_object,
name = "ListPolicy",
module = "_aerospike_async_native",
subclass,
Expand Down Expand Up @@ -1425,7 +1425,7 @@ use crate::record::PythonValue;

/// HLL policy for HLL operations and expressions.
#[gen_stub_pyclass(module = "_aerospike_async_native")]
#[pyclass(from_py_object,
#[pyclass(from_py_object,
name = "HLLPolicy",
module = "_aerospike_async_native",
subclass,
Expand Down Expand Up @@ -1478,7 +1478,7 @@ use crate::record::PythonValue;
////////////////////////////////////////////////////////////////////////////////////////////

#[gen_stub_pyclass(module = "_aerospike_async_native")]
#[pyclass(from_py_object,
#[pyclass(from_py_object,
name = "MapPolicy",
module = "_aerospike_async_native",
subclass,
Expand Down
9 changes: 8 additions & 1 deletion src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ use crate::policies::AdminPolicy;
self._as.supports_mrt()
}

/// Returns true if server accepts server-compiled AEL on filter field 43 (>= 8.1.3.0).
pub fn supports_server_compiled_ael(&self) -> bool {
true
// TODO: enable this when server changes are merged
// self._as.supports_server_compiled_ael()
}

pub fn __str__(&self) -> String {
format!("{}.{}.{}.{}", self._as.major, self._as.minor, self._as.patch, self._as.build)
}
Expand Down Expand Up @@ -448,7 +455,7 @@ use crate::policies::AdminPolicy;
**********************************************************************************/

#[gen_stub_pyclass(module = "_aerospike_async_native")]
#[pyclass(from_py_object,
#[pyclass(from_py_object,
name = "Privilege",
module = "_aerospike_async_native",
subclass,
Expand Down
9 changes: 9 additions & 0 deletions src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,15 @@ use crate::record::PythonValue;
.map_err(|e| PyErr::from(RustClientError(e)))
}

#[staticmethod]
/// Build a filter expression whose wire form is ``[128, "<ael>"]`` (MessagePack), so the
/// server (8.1.3+) parses and compiles the Aerospike Expression Language string.
pub fn from_server_compiled_ael(ael: &str) -> PyResult<FilterExpression> {
aerospike_core::expressions::pack_ael_server_filter(ael)
.map(|expr| FilterExpression { _as: expr })
.map_err(|e| PyErr::from(RustClientError(e)))
}

#[staticmethod]
/// Create unknown value. Used to intentionally fail an expression.
/// The failure can be ignored with `ExpWriteFlags` `EVAL_NO_FAIL`
Expand Down
Loading