I’m happy to announce package candidates for cql and cql-io (4.1.0.0 and 2.0.0). Together they make up a cassandra driver for haskell. There are a bunch of minor improvements, but there are two killer features in this release:
- Keeping multiple control connections open. The prior releases had at most one control connection open at any time, and this could lead to missed events and losing touch with the cluster in the worst case. Especially in an environment where addresses are likely to change, like kubernetes.
- Everything necessary for writing a token-aware policy. There are a few caveats to this, but it works pretty well. It only works for Murmur3, and it only works for prepared queries. I have a policy that does this and would be willing to share it upon request.
I don’t know if there are any other haskell projects using cassandra or scylladb as a backend, but I would really appreciate having some users that aren’t me evaluating the package candidates.
Or maybe you don’t have a haskell project using cassandra, but you do have a cassandra data base and would be willing to play around with the new candidates.
I plan on releasing the candidates in about a week. (The candidates are available now)
4 Likes
How did you handle the Murmur3 implementation? Cassandra utilizes a faulty Murmur3 implementation (signed Int64) which does not match the real Murmur3 (unsigned Int128). I personally utilized a C-library I found that was made to match Cassandra’s Murmur3.
Sadly, we dropped Haskell from our tech stack and on a later date we dropped Cassandra so can’t really test your implementation 
I did exactly that. I embedded (with attribution of course) This Library directly into the new version of the cql library. Using the embedded library was straightforward.
Feel free to ask more questions.
How did you test the hash values? I personally utilized a cql query (don’t remember what it was) that returned the partition hash value so I could manually check that my multi-argument partition keys were being correctly generated.
It was a while ago, but I vaguely recall doing that. I know I did use the cql token function to try and make sure I got it all right.
Honestly I should probably add some tests to the cql library with the solutions coming from calls to token made from cqlsh outside of the haskell library entirely.
These are written. Expect to see them in the github repo and the final release in a day or so.
And of course, why do we write tests? To find errors. I found a small error in computing the row keys related to text serialization. If anyone is trying out the package candidate, please update. A new candidate is up.