Skip to content

Commit

Permalink
CQL Vector type support
Browse files Browse the repository at this point in the history
This commit adds serializing and deserializing rune lists to/from CQL vectors.
  • Loading branch information
pkolaczk committed Aug 11, 2024
1 parent f6e0d85 commit 37bd264
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 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 @@ -40,7 +40,7 @@ rand_distr = "0.4"
regex = "1.5"
rune = "0.13"
rust-embed = "8"
scylla = { path = "../scylla-rust-driver/scylla", features = ["ssl"] }
scylla = { git = "https://github.com/pkolaczk/scylla-rust-driver.git", branch = "vector", features = ["ssl"] }
search_path = "0.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
9 changes: 9 additions & 0 deletions src/scripting/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ fn to_scylla_value(v: &Value, typ: &ColumnType) -> Result<CqlValue, CassError> {
.try_collect()?;
Ok(CqlValue::List(elements))
}
(Value::Vec(v), ColumnType::Vector(elt, _dim)) => {
let v = v.borrow_ref().unwrap();
let elements = v
.as_ref()
.iter()
.map(|v| to_scylla_value(v, elt))
.try_collect()?;
Ok(CqlValue::Vector(elements))
}
(Value::Vec(v), ColumnType::Set(elt)) => {
let v = v.borrow_ref().unwrap();
let elements = v
Expand Down

0 comments on commit 37bd264

Please sign in to comment.