daveliepmann / uruk Goto Github PK
View Code? Open in Web Editor NEWMarkLogic XCC in Clojure
License: Eclipse Public License 1.0
MarkLogic XCC in Clojure
License: Eclipse Public License 1.0
It seems that the variables argument to execute-xquery is not actually used down in the code. This is something that I actually need before I can really start using the library.
Hi Dave,
we'll need namespace support rather sooner than later, can you have a look at making uruk use [org.clojure/data.xml "0.1.0-beta1"]
?
Thanks!
Hans
Currently, XQuery parse and other MarkLogic errors are reported only superficially:
Show: Clojure Java REPL Tooling Duplicates All (11 frames hidden)
1. Unhandled com.marklogic.xcc.exceptions.XQueryException
Unexpected token
ServerExceptionHandler.java: 34 com.marklogic.xcc.impl.handlers.ServerExceptionHandler/handleResponse
EvalRequestController.java: 96 com.marklogic.xcc.impl.handlers.EvalRequestController/serverDialog
AbstractRequestController.java: 88 com.marklogic.xcc.impl.handlers.AbstractRequestController/runRequest
SessionImpl.java: 437 com.marklogic.xcc.impl.SessionImpl/submitRequestInternal
I think the exceptions contain very detailed information as to where the error is, and that should be made available to uruk users directly.
I observe that if a query returns only one result, execute-xquery
returns the single element, whereas if multiple results are matched, a sequence is returned. Is this done by XCC or by uruk? It would be nice if the caller of execute-xquery
could specify whether one or multiple results are returned. If one result is expected but the query returns more than one, an error should by signaled.
Hello,
We usually store the connections as plists now, so it would be nice to have an interface to the an interface to the other ContentSource methods specified in
https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/ContentSourceFactory.html
that base on host and port instead of uri.
And in addition to this specifying SecurityOptions could also get relevant.
What do you think about it? Right now I have some glue code that joins host and port to an xcc://-uri, but I'd like to get rid of that code.
Thank you and cheers,
Max
It should be possible to pass an XML element as argument to an XQuery invocation. The given argument should be efficiently converted so that it is possible to either pass hiccup-style s-expression encoded elements or clojure.data.xml.Element instances.
I think this is what causes a project to fail if clojure.edn has not been required yet when uruk itself is being required.
Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.main.(main.java:20)
Caused by: java.lang.ClassNotFoundException: clojure.edn, compiling:(uruk/core.clj:79:7)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6875)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$IfExpr$Parser.parse(Compiler.java:2797)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6319)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler.eval(Compiler.java:6931)
at clojure.lang.Compiler.load(Compiler.java:7379)
I notice that you're using & {:keys [options variables types]}
in some function signatures. Can you change those so that options are passed as map instead ({:keys [options variables types]}
). Doing it that way makes it easier to compose functions.
While I can pass on a variable value as, for instance, {:group-plan-ids {:value [1 2 3] :type :sequence}}
, the error that gets returned tells me that I should convert the values first to XdmValues:
Exception java.lang.IllegalArgumentException: Value must be array of XdmValue com.marklogic.xcc.ValueFactory.newSequenceValue ...
Would it be feasible to have uruk take care of that conversion?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.