reveal-sdk-node
Version:
RevealBI Node.js SDK
97 lines (96 loc) • 3.26 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RVSqlServerDataSource = void 0;
const RVSqlPDSDataSource_1 = require("../AbstractClasses/RVSqlPDSDataSource");
/** Microsoft SQL Server data source. */
class RVSqlServerDataSource extends RVSqlPDSDataSource_1.RVSqlPDSDataSource {
/** @hidden */
constructor(json) {
super(json);
this._database = null;
this._schema = null;
this._encrypt = null;
this._trustServerCertificate = null;
if (json) {
var props = json["Properties"];
if (props) {
this._database = props["Database"];
this._schema = props["Schema"];
this._encrypt = props["Encrypt"];
this._trustServerCertificate = props["TrustServerCertificate"];
}
}
}
/** Name of the database to connect to. */
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;
}
/** Set the Encrypt flag in the connection string to the given value, only supported for .NET backends */
get encrypt() {
return this._encrypt;
}
set encrypt(value) {
this._encrypt = value;
}
/** Set the TrustServerCertificate flag in the connection string to the given value, only supported for .NET backends */
get trustServerCertificate() {
return this._trustServerCertificate;
}
set trustServerCertificate(value) {
this._trustServerCertificate = value;
}
/** @hidden */
toJson() {
var json = super.toJson();
var props = json["Properties"];
props["Database"] = this._database;
if (this._schema != null) {
props["Schema"] = this._schema;
}
if (this._encrypt != null) {
props["Encrypt"] = this._encrypt;
}
if (this._trustServerCertificate != null) {
props["TrustServerCertificate"] = this._trustServerCertificate;
}
return json;
}
/** @hidden */
getProviderKey() {
return 'SQLSERVER';
}
/** @hidden */
getType() {
return "RVSqlServerDataSource";
}
/** @hidden */
_getWrapper() {
var wrapper = super._getWrapper();
wrapper.database(this.database);
wrapper.schema(this.schema);
if (this._encrypt != null) {
wrapper.encrypt($.ig.NativeDataLayerUtility.prototype.wrapBool(this._encrypt));
}
if (this._trustServerCertificate != null) {
wrapper.trustServerCertificate($.ig.NativeDataLayerUtility.prototype.wrapBool(this._trustServerCertificate));
}
if (this.host !== null && !this.host.includes("\\") && this.port == 0) {
this.port = 1433;
}
if (this.host !== null && this.host.includes("\\")) {
this.port = -1;
}
return wrapper;
}
}
exports.RVSqlServerDataSource = RVSqlServerDataSource;