UNPKG

reveal-sdk-node

Version:

RevealBI Node.js SDK

87 lines (86 loc) 3.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RVDuckDBDataSource = void 0; const RVDashboardDataSource_1 = require("../AbstractClasses/RVDashboardDataSource"); /** * DuckDB data source. */ class RVDuckDBDataSource extends RVDashboardDataSource_1.RVDashboardDataSource { /** @hidden */ constructor(json) { var _a, _b; super(json); this._database = null; this._schema = null; this._processDataOnServerDefaultValue = false; this._processDataOnServerReadOnly = false; if (json) { var props = json["Properties"]; if (props) { this._database = (_a = props["Database"]) !== null && _a !== void 0 ? _a : null; this._schema = (_b = props["Schema"]) !== null && _b !== void 0 ? _b : null; this._processDataOnServerDefaultValue = props["ServerAggregationDefault"]; this._processDataOnServerReadOnly = props["ServerAggregationReadOnly"]; } } else { this._processDataOnServerDefaultValue = true; } } /** @hidden */ toJson() { var json = super.toJson(); var props = json["Properties"]; props["Database"] = this._database; props["Schema"] = this._schema; props["ServerAggregationDefault"] = this._processDataOnServerDefaultValue; props["ServerAggregationReadOnly"] = this._processDataOnServerReadOnly; return json; } /** @hidden */ getProviderKey() { return "DUCKDB"; } /** @hidden */ getType() { return "RVDuckDBDataSource"; } /** * Path of the DuckDB database file. Accepts both absolute paths and relative paths. * For MotherDuck use "md:databaseName" as the database value. */ get database() { return this._database; } set database(value) { this._database = value; } /** Name of the schema to use. */ get schema() { return this._schema; } set schema(value) { this._schema = value; } /** * Sets the default value for "Process Data on Server" option for this data source, the * end user can still change the value, unless {@link processDataOnServerReadOnly} is true. */ get processDataOnServerDefaultValue() { return this._processDataOnServerDefaultValue; } set processDataOnServerDefaultValue(value) { this._processDataOnServerDefaultValue = value; } /** * When set to true the user will not be allowed to change the value for "Process Data on Server" option * and the default value will be used. */ get processDataOnServerReadOnly() { return this._processDataOnServerReadOnly; } set processDataOnServerReadOnly(value) { this._processDataOnServerReadOnly = value; } } exports.RVDuckDBDataSource = RVDuckDBDataSource;