scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
582 stars 101 forks source link

Use empty `CollectionType<T>` instead of `Option<CollectionType<T>>` #1001

Open Zk2u opened 5 months ago

Zk2u commented 5 months ago

While ScyllaDB doesn’t distinguish between null and and empty set, it’s not very ergonomic to represent these collections as Option<CollectionType<T>>. For example, an empty set in Scylla should be deserialised into an empty HashSet<T>, not a None::<CollectionType<T>>.

This would be a breaking API change.

wprzytula commented 5 months ago

I'll include this functionality in the ongoing deserialization refactor, planned for release 0.14.

wprzytula commented 5 months ago

@617a7aa Please take a look at #1007. Please confirm that the behaviour showcased by the added test is in line with your expectations.

Zk2u commented 5 months ago

ACK, looks good to me.