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

Refactor of the schema macros as well as unification of the 'put' functi... #12

Merged
merged 2 commits into from
Dec 22, 2011
Merged

Refactor of the schema macros as well as unification of the 'put' functi... #12

merged 2 commits into from
Dec 22, 2011

Conversation

nickmbailey
Copy link
Collaborator

This pull request does a few things.

  • It unifies the 'put' functions. 'put-counter' no longer exists. Instead you can either add a ':counter true' option to the call to put, or you can use the with-schema macro to indicate that the cf is a counter cf to avoid the extra args.
  • It also modifes the behavior of the put function in regards to super columns. Before if the value was a map, then it was considered a super column. Now you still pass the values the same but you also need to pass ':type :super' as an argument (or use the with-schema macro). The main reasoning behind this is custom serializers. We implement a custom serializer that turns a clojure map into a custom byte array format. That wouldn't work with the previous implementation. The new implementaiton also leaves room to more easily add composite column support.
  • Removed the defschema macro since it was simply creating a map. Now users will create a regular clojure map representing their schema and pass that to with-schemas. Also, the put function now respects things set using the with-schema macro.

Mostly this sets up the client as having the 'with-schema' approach being the preferred way to interact with cassandra, although you can do without it. I think this approach will allow for more unification of the different methods (super, counter, regular) and a better experience from the client. Also at some point some intelligent detection of default schema options can be done based on comparator, default_validation, sub_comparator, etc options.

pingles added a commit that referenced this pull request Dec 22, 2011
Refactor of the schema macros as well as unification of the 'put' functi...
@pingles pingles merged commit 19bdae3 into pingles:master Dec 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants