SDK for generating the properly formatted query strings based on the API documented at developer.domo.com. This is the default export of the library.

Example Usage

import { SqlClient as Query } from '@domoinc/toolkit';

const datasetAlias = 'dsAlias';

(new Query())
.get('alias', `select * from ${datasetalias}`)
.then((data) => {
// do something with the data
console.table(data);
});

Hierarchy

  • SqlClient

Constructors

Methods

Constructors

Methods

  • A helper method for generating a GET request. This method also enables caching requests. It uses the v2 endpoint, so column names refer to the aliases in your app's manifest.

    Parameters

    • alias: string
    • query: string

    Returns Promise<Response<SqlResponse>>

  • A helper method for reading page filters and transforming each of them into a SQL predicate. e.g. "First Name" = 'Stephen Strange. There is also an overload version that will concatenate the predicates together into WHERE and HAVING clauses (if any, for each). To get the concatenated predicates, set produceClauses to true.

    Parameters

    • datasets: string[]

    Returns Record<string, SQLPredicateBlock[]>

  • Parameters

    • datasets: string[]
    • produceClauses: boolean

    Returns Record<string, SQLClauseResult>

Generated using TypeDoc