Skip to content
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

compile-time safety for cassandra queries #27

Open
sullivan- opened this issue Jul 6, 2017 · 0 comments
Open

compile-time safety for cassandra queries #27

sullivan- opened this issue Jul 6, 2017 · 0 comments

Comments

@sullivan-
Copy link
Member

Right now, a number of queries will throw exception on cassandra. For instance, a query with an OR clause. Here's my idea for making this typesafe:

  • add a type parameter to LongevityContext and Repo for the back end. Those types already exist in longevity.config.BackEnd. We will probably need to pull this as a configuration var at the same time. If so, we probably want to move that class hierarchy too - perhaps into longevity.context? Or into a new longevity.backend package.
  • Create a type class OrSupport[_ <: BackEnd]. Give it a private[longevity] constructor so people can't create their own.
  • Create implicit OrSupport[MongoDB], etc., for the back ends that support or queries. Put them where they will be found by implicit search - probably in the OrSupport companion object would be best.
  • Add an implicit OrSupport[BE] argument for the "or" query methods - both in the query ADT and the query DSL.
  • Repeat for other query clauses that don't work on Cassandra.
  • Don't forget to delete the cassandra specific query exception classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant