-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
expanded triplestore interface and pluggable backends #38
Comments
I have a local branch that I think covers this fairly well. View diff here: https://github.com/pbnjay/cayley/compare/triplestore_registry It implements a TripleStore registry using a TripleStoreGetter (which returns a TripleStore instance by name), and a TripleStoreInit func (which creates a TripleStore schema if necessary). TripleStoreInit can't be an interface method since some backends may require init before returning an instance. I also added an optional BulkLoad interface (skipped if not implemented). It returns a boolean success, so if it fails then it can revert to the standard load mechanism. I'm waiting on lawyers for the CLA... will submit a PR once they give the OK. |
Looks good to me -- I'll give it a run as well, but on first review, seems good. Add the appropriate A+C when the lawyers come back? |
A few comments on this before you send, so please wait for me to be at a real keyboard. |
I can't comment on that branch, so I'll do so here. The func Where you call I know that variadic arguments can be used to mimic optional arguments, but it's really not a good thing to do just to save typing since it drops a whole class of programmer errors. I have others, but I'll wait until the PR comes. Generally LGTM. |
|
It really only needs to be non-nil. This can be extended later to cover http://golang.org/pkg/net/#Error
Yes, I understand the reason behind the distinction though I feel that |
We need the temporary error to cover the existing MongoDB Init+Load Yes, I understand the reason behind the distinction though I feel that
If we went similar to the |
I [think] an Error interface that covers all use cases is preferable from an
Can we use NewStoreFunc and InitStoreFunc for now with the possibility |
I don't know about conflating all the use cases into a single interface. A These are trivial nits, we can just mix the two concepts. Named errors can
Sounds good |
On Thu, 2014-07-17 at 19:57 -0700, Jeremy Jay wrote:
My comment above was too strong - I will rephrase that I would prefer As far as using named errors though it it potentially dangerous to Just to note here what I am thinking with the error propagation, the |
The quick answer is that LGPL isn't going to work, so we'll have to make do -- see http://www.apache.org/legal/resolved.html |
That's a pity - though note below. Note that that is a preclusion on incorporation of LGPL into products that would want to retain an Apache2.0 license. The reason I am interested in this package is that it handles error propagation across goroutine boundaries (normal error propagation is only back up a stack). After rummaging, I have found Rog's original package which is under a simplified BSD license, here: http://godoc.org/launchpad.net/errgo/errors and http://godoc.org/launchpad.net/errgo/v2/errors. This should be OK as far a licensing goes. |
Yeah, having dealt with the license bit for a while it is a bit of a pity. BSD is great though, so have at it! |
Fixed in the merge. |
Update on the license. Roger Peppe has added a LICENCE file and move the error handling package to github under gopkg.in. I've been waiting for this since previously the license was only specified on the launchpad package front page. |
I'd suggest a slightly expanded TripleStore interface which would let you move a lot of the backend-specific code out of
db/init.go
db/load.go
anddb/open.go
. It would make the integration points a little more obvious for new backends.Here's an Initial list of methods based on the above files:
I'd also suggest a central registry / factory of backends to make the above files cleaner and allow new modules to use them transparently.
The text was updated successfully, but these errors were encountered: