New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra support #773

Open
tupshin opened this Issue Mar 3, 2017 · 8 comments

Comments

Projects
None yet
4 participants
@tupshin

tupshin commented Mar 3, 2017

I have filed AlexPikalov/cdrs#110 so I thought I might as well file a ticket here as well.

I'm interested in adding Cassandra support to Diesel in upcoming weeks, and would love to find any interested collaborators.

From the initial poking that I've done, I don't see any design choices that would preclude using most features of diesel with a non-relational nosql store like Cassandra, but please let me know if I've missed something.
The CDRS driver is new but stabilizing quickly, and is a pure rust implementation of the CQL protocol that Cassandra uses.

The CQL language is similar to SQL, and is conceptually a subset of SQL, even though not a strict subset. It notably lacks relational joins and a number of other features, but it provides familiar SELECT FOO FROM BAR WHERE BAZ type syntax, etc.

Any thoughts/ideas/suggestions for how to tackle the integration would be welcome (I'm going to be modeling off the sqlite implementation). I'll also hang out on your gitter when I'm working on it.

@AlexPikalov

This comment has been minimized.

AlexPikalov commented Mar 3, 2017

@tupshin I could help with this stuff if there'd be an agreement that it makes sense.

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 3, 2017

The process that I go through for adding a new impl is basically just pub struct NewConnection; impl Connection for NewConnection {} and then let the compiler tell me what to do next (placing unimplemented!() in the bodies of every method definition). Once that's done, I run the test suite and let the failures from unimplemented!() calls tell me where to go from there.

I'm happy to provide whatever support I can for this, but I would want this to be a third party crate, not a pull request to Diesel itself.

@tupshin

This comment has been minimized.

tupshin commented Mar 3, 2017

Agree about a third party crate, and thanks, that's a very useful suggestion for how to approach it.

@tupshin

This comment has been minimized.

tupshin commented Mar 3, 2017

As an out-of-tree effort, how would I go about running the test suite against my implementation?

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 3, 2017

As an out-of-tree effort, how would I go about running the test suite against my implementation?

That is an excellent question that I wish I had an answer to. Short term I'd just pull down the repository, and add your crate as an optional dependency, and test locally that way.

One thing I forgot to mention is that if you do write a full adapter, you'll want it to work with Diesel CLI and Diesel Codegen. I'm fine with adding the minimal code required to add a cassandra variant to this enum and the equivalents from other crates, where the match arms basically just call out to your crate for functionality.

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 3, 2017

I guess the long term answer is that you'll be the first out of tree adapter, so we'll figure something out. Once the crate gets a bit farther along we'll probably add whatever code we need to the test suite, but not run that branch on Travis (or at least put it as an allowed failure)

@tyranron

This comment has been minimized.

tyranron commented Jun 8, 2018

@AlexPikalov

This comment has been minimized.

AlexPikalov commented Jun 9, 2018

@tyranron unfortunately, no news from my side. During last months, I was involved into development of version 2 of the driver. I'd like to start working on that ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment