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

Use clojure.spec for query validation and shaping #168

Open
danielcompton opened this issue Jun 6, 2016 · 0 comments
Open

Use clojure.spec for query validation and shaping #168

danielcompton opened this issue Jun 6, 2016 · 0 comments

Comments

@danielcompton
Copy link
Collaborator

danielcompton commented Jun 6, 2016

Clojure.spec could be really useful for clj-rethinkdb. Currently we have some functions with ambiguous arities and we need to do adhoc runtime type checking to resolve it. In other cases we just haven't attempted some arities when they could be useful. specing functions would (I think?) allow us to get around this, and provide a more structured way for handling functions with the same arity but different possible behaviours.

Query validation would also be possible. This could be very loose, e.g. making sure the types for each argument are correct, or much more rich, i.e. enforcing that an insert call has been called with a table.

Things to look at:

  • What is the runtime cost of this?
  • Which functions would benefit from this?
  • Do the benefits outweigh the costs?

spec is very new, so we probably wouldn't be merging anything based on this until Clojure released it officially.

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