Giter VIP home page Giter VIP logo

uruk's Issues

allow create-session[*] to have specified host and port separatedly instead of URI

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

Support XML element argument type

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.

Options as "&rest" arguments

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.

Is uruk converting single-element result sequences into the single element?

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.

execute-xquery and variables

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.

Improve exception reporting

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.

clojure.edn is called without being required

code

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)

Automatic conversion from clojure types to equivalent XDMValues

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.