Crates.io | scylla-macros-flex |
lib.rs | scylla-macros-flex |
version | 1.5.5 |
source | src |
created_at | 2022-04-23 21:07:16.707432 |
updated_at | 2024-10-02 21:54:46.515778 |
description | This fork of scylla-macros provide alternative parsers with improved compatibility when reading rows & UDTs. |
homepage | |
repository | https://github.com/merlleu/scylla-macros-flex |
max_upload_size | |
id | 572807 |
size | 27,097 |
This crate defines two derive macros:
FromRowFlex:
FromUserTypeFlex:
Allows you to use arbitrary structs serialized with serde_json, stored as text in Scylla/Cassandra.
They have approximately the same behavior as UDT.
Requires "serde_json" feature.
- FromJson
- IntoJson
- Way more flexible than CQL **FROZEN** UDTs thanks to Rust enums
- Schema can be changed a lot without any issue.
- Can take more space than UDT
- Can be slower than UDTs
Allows you to use arbitrary structs serialized with MessagePack, stored as Blobs in Scylla/Cassandra.
They have approximately the same behavior as UDT.
Requires "rmp-serde" feature.
- FromMessagePack
- IntoMessagePack
- Way more flexible than CQL **FROZEN** UDTs thanks to Rust enums
- Schema can be changed a lot without any issue.
- Most of the time uses less space than UDT
- Can be slower than UDTs
Allows you to use arbitrary structs serialized with speedy, stored as Blobs in Scylla/Cassandra.
Use this only if you won't change your schema later. They have approximately the same behavior as UDT.
Requires "speedy" feature.
- FromSpeedy
- IntoSpeedy
- Way more flexible than CQL **FROZEN** UDTs thanks to Rust enums
- Less storage required than UDTs because udt include fields names & udt names
- Faster than UDT (because speedy is quite fast)
- You can't update a field in an atomic manner (like frozen UDTs)
- Changing your schema (eg. adding a field to a struct inside a Vec) will break everything.