Triton - a Cassandra ORM for Elixir

Triton uses the Xandra driver underneath.

Hex:

Github:

Blog:
https://blog.sleeperbot.com/triton-a-cassandra-orm-for-elixir-882dd8f11383

6 Likes

Thanks for sharing Triton. I am working on a project where I need to store IOT data in Cassandra and do range based queries on clustering columns. e.g. I have temperature sensors data table, where sensor-id is partitioning key, and timestamp is clustering column. I have queries like

select val from temp_sensors where sensor_id = ‘xyz’ and timestamp =< 1521829277556 and timestamp >= 1521827277556

I have read the docs but couldn’t figure out how I can model above query using DSL provided by this lib. Please help.

I’ve added more documentation to the github page.

You can do comparison / range queries with like this:

MessagesByDate
|> select([:message_id, :text])
|> where(channel_id: 1, created: [">=": timestamp_a], created: [<: timestamp_b])
|> MessagesByDate.all
3 Likes

The documentation blog url is not working @weixiyen

Can you please check?