Closed brianhiss closed 5 years ago
Not currently supported, but it's a great idea. I'll start working on it when I get a chance.
On Fri, Feb 15, 2019, 5:49 PM Brian M Hiss <notifications@github.com wrote:
@timshannon https://github.com/timshannon,
I enjoyed reading your article comparing boltdb-vs-badger. I've been flopping back and forth between the two of them, balancing the pros and cons of each.
That being said, I've been playing around with badgerhold. I wanted to know if you support anything like Storm, unique constraints on a field within a struct?
type User struct { ThePrimaryKey string
storm:"id"
// primary key Group stringstorm:"index"
// this field will be indexed Email stringstorm:"unique"
// this field will be indexed with a unique constraint Name string // this field will not be indexed }If not, is this something you'd consider? Doesn't seem like bolthold supports that use case either, but I've only skimmed through it and haven't used it extensively.
Thanks again for all your contributions, code and research.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timshannon/badgerhold/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRNNaTiTq_zmFiLedlqesAAx0RCquoOks5vN0dzgaJpZM4a-ob9 .
PR #7 Adds unique constraint support. All of my tests are passing, but if you run into any issues with it, because to open up an issue.
Thanks,
@timshannon, that was fast!
How do you use this, don't see anything in the docs yet? Something like:
`badgerhold:"unique"`
Well shoot, I knew I forgot something.
Yeah that's exactly what you do. I'll update the README.
Thanks,
README updated, thanks for the heads up.
Looks good, thanks! Will make it a lot more powerful for some interesting use cases.
@timshannon,
I enjoyed reading your article comparing boltdb-vs-badger. I've been flopping back and forth between the two of them, balancing the pros and cons of each.
That being said, I've been playing around with badgerhold. I wanted to know if you support anything like Storm, unique constraints on a field within a struct?
If not, is this something you'd consider? Doesn't seem like bolthold supports that use case either, but I've only skimmed through it and haven't used it extensively.
Thanks again for all your contributions, code and research.