reveal-sdk-node
Version:
RevealBI Node.js SDK
90 lines (89 loc) • 2.71 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RVSnowflakeDataSource = void 0;
const RVSqlPDSDataSource_1 = require("../AbstractClasses/RVSqlPDSDataSource");
/**
* Snowflake data source, it adds the database name property to the base properties inherited from the abstract class RVSqlBasedDataSource.
*/
class RVSnowflakeDataSource extends RVSqlPDSDataSource_1.RVSqlPDSDataSource {
/** @hidden */
constructor(json) {
super(json);
this._database = null;
this._account = null;
this._warehouse = null;
this._role = null;
this._schema = null;
if (json) {
var props = json.Properties;
this._account = props['Account'];
this._database = props["Database"];
this._warehouse = props["Warehouse"];
this._role = props["Role"];
this._schema = props["Schema"];
}
}
/** @hidden */
toJson() {
var json = super.toJson();
var props = json.Properties;
props['Account'] = this._account;
props["Database"] = this._database;
props["Warehouse"] = this._warehouse;
props["Role"] = this._role;
props["Schema"] = this._schema;
return json;
}
/** @hidden */
getProviderKey() {
return 'SNOWFLAKE';
}
/** Name of the database to connect to. */
get database() {
return this._database;
}
set database(value) {
this._database = value;
}
/** Snowflake account, needed only when using WPF or .NET, not needed for Java SDK. */
get account() {
return this._account;
}
set account(value) {
this._account = value;
}
/** Snowflake warehouse, it is optional. */
get warehouse() {
return this._warehouse;
}
set warehouse(value) {
this._warehouse = value;
}
/** Snowflake role, it is optional. */
get role() {
return this._role;
}
set role(value) {
this._role = value;
}
/** Snowflake schema, it is optional. */
get schema() {
return this._schema;
}
set schema(value) {
this._schema = value;
}
getType() {
return "RVSnowflakeDataSource";
}
_getWrapper() {
var wrapper = super._getWrapper();
wrapper.database(this.database);
wrapper.account(this.account);
wrapper.warehouse(this.warehouse);
wrapper.role(this.role);
wrapper.schema(this.schema);
return wrapper;
}
}
exports.RVSnowflakeDataSource = RVSnowflakeDataSource;