nodecosmos / charybdis

Rust ORM for ScyllaDB and Apache Cassandra
MIT License
108 stars 6 forks source link

Static Columns #14

Closed hadronzoo closed 3 months ago

hadronzoo commented 3 months ago

In a model, how does one mark a field as a static column?

GoranBrkuljan commented 3 months ago

ATM it's not possible to do it. I guess we only need it for our migration tool.

However, if you are interested, PR would be welcomed. For now I would recommend to follow our (unconventional) macro declaration approach:

#[charybdis_model(
    table_name = users,
    partition_keys = [id],
    clustering_keys = [],
    static_columns = [static_field]
)]
pub struct User {
    id: Uuid,
    static_field: Text,
    ...
}

In future we might replace all of those with more idiomatic helper attributes depending on the feedback.

GoranBrkuljan commented 3 months ago

Added support for static columns in latest release. v0.4.14