xquery-mode / cider-any

Evaluate any buffer in cider – Replaced by Oook
0 stars 1 forks source link

Replace URI by host+port #15

Closed m-g-r closed 7 years ago

m-g-r commented 7 years ago

I suggest to switch from URI for host+port to separate host and port.

Reason: Actually the URI is meant to be an alternative to specify everything: protocol://user:password@host:port/content-base but cider-any-uruk uses separate variables for user, password, and content-base.

So let's also split the URI into separate variables for host and port.

scripts/init.el is updated as well but I did not test it.

proofit404 commented 7 years ago

Maybe instead of splitting it into 5 different variables we can use one url value at Emacs Lisp level, perform url split then and submit extracted values to the uruk level. What do you think?

m-g-r commented 7 years ago

Actually, I'd just use a list of form (host port user password content-base). I do that already internally. I would want to do url spiltting and such things.

And while we are at this, probably add the option to include the sixth member: security-options, which uruk already supports. see: https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/ContentSourceFactory.html

Cheers, Max

m-g-r commented 7 years ago

Still, I think this is better than the current state. It could be replaced by a list in a separate commit.

hanshuebner commented 7 years ago

I don't think how Wolfgang Petry is relevant to this PR :)

Even if the list never needs to be constructed by a person, having 6 positions with different meanings is rather unwieldly. I'd use a plist, but maybe that is not the emacs way. ​

proofit404 commented 7 years ago

I think plist is pretty cool option for manual config. Its indeed have meaningful structure. I'll look how we can adapt dbselector for this convention.

m-g-r commented 7 years ago

Ah, sorry, actually I use plists: (:host "localhost" :port "8021" :user "admin" :password "admin")

I use a function map-to-plist in clojure, while cider-any-uruk contains the counterpart cider-any-uruk-plist-to-map. And in Emacs Lisp there is plist-get to access property lists.

m-g-r commented 7 years ago

Ok, I did the change to a property list now.

Customization also works as plist; tested, although I don't use it. Maybe you can improve on that but I think it is ok as I specified a default plist (with nil values for the values).

(The dbselector example is just optional (and we don't use it right now), so that shouldn't be an impediment.)

proofit404 commented 7 years ago

@m-g-r I'm sorry I wasn't active more then a week. My business trip ended yesterday, updates to project coming soon.