ubquery offers a streamlined method for extracting data from Unibase, particularly designed for seamless integration with JavaScript front-end applications. This read-only utility takes a single JSON object as input, which it then parses to generate flags for the underlying ubdump tool. By accepting a structured JSON payload specifying the target table, key, matching criteria, and desired attributes, ubquery simplifies the process of retrieving specific information from Unibase, making it ideal for dynamic data display in web interfaces and also well-suited for use in server-side environments like Node.js.
Name
ubquery – a JSON front end for ubdump
Synopsis
ubquery <JSON>
Description
ubquery accepts a single argument that is a JSON object and parses it to get flags for ubdump.
This is a read-only utility and cannot be used to modify a table.
It’s main use is to make it easy to extract data from Unibase from within a Javascript frontend application.
eg
unibase.dataCGI ({"PROC_NAME": "ubquery", "ARG": {"table": "customer", "key": "name", "match": "Zenucom Pty Ltd", "attribute": "[website]"}, (data) => { ...do something ...}}
IYou can of course call it from any script, and it suits use with Node.js.
The JSON format is {“table”: “…”, “key”: “…”, “match”: “…”, “attribute”: “…”}
This table is required, the others are optional.
If you do not give the attribute, ubdump returns a simple dump of record(s). If you give the attribute, ubdump uses the attribute value as the format for the ‘-a’ flag.