Skip to content

Proposal: a macro for expressions like WRITETIME(field)/TTL(field) #43

Open
@kakserpom

Description

@kakserpom

Example:

#[charybdis_model(
    table_name = users,
    partition_keys = [id],
    clustering_keys = [],
)]
pub struct User {

    id: Uuid,
    #[charybdis_expr("WRITETIME(id)")]
    id_writetime: Option<Timestamp>,
    tags: Set<Text>,
    post_ids: List<Uuid>,
}

id_writetime will be a read-only field (ignored by insert() and update())

SELECT queries will include WRITETIME(id) and the column will be mapped to id_writetime

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions