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

Add set in table creation #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

annismckenzie
Copy link

TL;DR: I needed a way to tell gocqltable to handle a slice in the model struct definition as a set in CQL and not as a list.

Not really happy with the amount of code needed to get this in here. Along the way, I fixed a few of go vet's concerns regarding certain code constructs, safely exposed the struct information map to the outside world (now usable in your project using gocqltable) and added a way to query indexed map/list/set values (or keys) via CQL's CONTAINS clause. There's a few basic tests added in there as well so maybe there's parts of this you want to pull into upstream.

I'll be using Go 1.6's vendor feature to embed my fork in the current project (forks were a real pain before – maybe we should do this for the dependencies of gocqltable as well?) so I'm not in a rush to get this merged.

Thanks for the library!

return s, found
}

func (t *typeMap) set(rt r.Type, v *StructInfo) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setter is only used internally so shouldn't be exposed to the outside world.

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.

1 participant