reveal-sdk-node
Version:
RevealBI Node.js SDK
82 lines (81 loc) • 2.89 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RVPostgresDataSourceItem = void 0;
const RVSqlPDSDataSourceItem_1 = require("../AbstractClasses/RVSqlPDSDataSourceItem");
const RVPostgresDataSource_1 = require("./RVPostgresDataSource");
/** PostgreSQL data source item */
class RVPostgresDataSourceItem extends RVSqlPDSDataSourceItem_1.RVSqlPDSDataSourceItem {
/** @hidden */
constructor(arg) {
super(arg);
this._schema = null;
this._functionName = null;
this._functionParameters = null;
// @if SERVER_SDK
this._customQuery = null;
this._customQueryParameters = null;
if (!(arg instanceof RVPostgresDataSource_1.RVPostgresDataSource)) {
var props = arg.Properties;
this._schema = props["Schema"];
this._functionName = props["Function"];
if (this._functionName)
this._functionParameters = arg["Parameters"];
// @if SERVER_SDK
this.deserializeCustomQuerySupport(arg, true);
// @endif
}
}
/** @hidden */
toJson() {
var json = super.toJson();
var props = json['Properties'];
props['Schema'] = this._schema;
props['Function'] = this._functionName;
// @if SERVER_SDK
this.serializeCustomQuerySupport(json, true);
// @endif
if (this._functionName) {
//copy functionParameters values to parameters
Object.assign(json['Parameters'], this._functionParameters);
}
return json;
}
/** Name of the schema the referenced table belongs to */
get schema() {
return this._schema;
}
set schema(value) {
this._schema = value;
}
/** (Optional) name of the function to get data from, the function is expected to return a result set and might have multiple parameters. */
get functionName() {
return this._functionName;
}
set functionName(value) {
this._functionName = value;
}
/** Parameters to be passed to the function, if there is such specified in {@link RVPostgresDataSourceItem.functionName}. */
get functionParameters() {
return this._functionParameters;
}
set functionParameters(value) {
this._functionParameters = value;
}
/** @hidden */
getType() {
return "RVPostgresDataSourceItem";
}
get customQuery() {
return this._customQuery;
}
set customQuery(value) {
this._customQuery = value;
}
get customQueryParameters() {
return this._customQueryParameters;
}
set customQueryParameters(value) {
this._customQueryParameters = value;
}
}
exports.RVPostgresDataSourceItem = RVPostgresDataSourceItem;