-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add support for query-based views #659
Comments
Good idea @dmcassel - just curious, do you have a custom task or anything that does this already? This would be a nice addition for all the Optic-based testing we do on our connectors too; we typically only use TDE's. Having this would make it easier to include QBV's for testing, to at least sanity check that those work fine too. |
@rjrudin I don't have a custom task yet. This idea came from exploring the QBV feature and thinking about how to deploy it. I can picture a custom task that would include the query and do the insert, but I haven't written one. |
We have deployed QBVs by pre-generating them in QC or such, although we have a Task that can evaluate adhoc queries too (I'll share below). Once generated, you can put them in ml-schemas/qbv/ (folder is arbitrary I think). Put a collections.properties next to it which adds 'http://marklogic.com/xdmp/qbv'. permissions.properties works in the same way as with TDEs, although it is suggested to use/add 'query-view-admin'. mlLS works well after that. Here my runScript task, which expects either -Pxquery={path} or -Pjavascript={path}, and also supports a -Poutput={path}. It is not well tested, but seems to work fine so far:
|
I considered the idea of using QC to generate, then writing the results and using What you provided is interesting for ad hoc queries; thanks! |
Yeah, you want to have the code in the repo as well. We wanted to have both. That is the reason why I came up with the runScript task. We put the code in src/main/runScripts/. You can still decide to copy-paste it into QC, and run it from there. But I can see why generating, and including it in deployment automatically would be convenient. |
I was mainly sharing my runScript task as a workaround :) (and for other uses ;) |
@dmcassel @grtjn How about the following design for a user:
When the user deploys their app or loads schemas, ml-gradle will then send each script to /v1/eval, which will return an XML I think That seem like a good design? |
@dmcassel @grtjn - I've created a PR for this feature in the ml-javaclient-util project. Check it out and let me know if you have any thoughts: marklogic/ml-javaclient-util#182 |
@BillFarber I haven't tested it, but from the code I think it looks great -- thanks for taking this on! |
This is all implemented in ml-javaclient-util. |
As far as I can tell, ml-gradle does not directly support creation or deployment of query-based views.
Proposal:
.generateView
).mlLoadSchemas
to locate those files, invoke them, and store the resulting XML in the application's schemas database.The text was updated successfully, but these errors were encountered: