nodecosmos / charybdis

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

Time to Live support #42

Open kakserpom opened 2 weeks ago

kakserpom commented 2 weeks ago

I would like insert_using_ttl() and update_using_ttl() operations to be added.

Also, it would be nice to be able to generate TTL(foo) in selects.

Scylla docs: https://opensource.docs.scylladb.com/stable/cql/time-to-live.html

GoranBrkuljan commented 2 weeks ago

Not planning it ATM, I'll assign myself when I get a chance. Meanwhile, PR is welcomed. insert_using_ttl(seconds: u32) and update_using_ttl(seconds: u32) are good.

kakserpom commented 2 weeks ago

I would use time::Duration.

GoranBrkuljan commented 2 weeks ago

TTL in scylla query is specified in seconds so I thought it's just easier. However, you are right, we could have duration and convert it in seconds within method.