Class: SlashDBClient

SlashDBClient(config)

Stores parameters necessary to communicate with a SlashDB instance and provides methods for retrieving metadata from the instance.

Constructor

new SlashDBClient(config)

Creates a SlashDB client to connect to a SlashDB instance.

Parameters:
Name Type Description
config Object
Properties
Name Type Description
host string

hostname/IP address of the SlashDB instance, including protocol and port number (e.g. http://192.168.1.1:8080)

apiKey string

optional API key associated with username

sso Object

optional settings to login with Single Sign-On

Properties
Name Type Description
idpId string

optional identity provider id configured in SlashDB

redirectUri string

optional redirect uri to redirect browser after sign in

popUp boolean

optional flag to sign in against the identity provider with a Pop Up window (false by default)

Source:

Methods

(async) buildSSORedirect()

Builds a SSO session from a redirect url, if popUp is not used, this method must be used in the redirect page handler .

Source:

(async) getDatabases() → {Object}

Retrieve a list of databases that are configured on the SlashDB instance

Source:
Returns:

databases - a key/value pair object keyed by database ID, with
a corresponding DataDiscoveryDatabase object for each key

Type
Object

(async) getDbDef(dbNameopt, guiDataopt) → {object}

Returns configuration info about SlashDB databases

Parameters:
Name Type Attributes Default Description
dbName string | undefined <optional>

database ID of database to filter on; leave empty to retrieve all databases

guiData boolean <optional>
false

returns additional info normally available in the GUI view when set to true

Source:
Returns:

containing configuration info for all or selected databases

Type
object

(async) getQueries(dbNameopt) → {object}

Retrieve a list of SQL Pass-Thru queries that are configured on the SlashDB instance

Parameters:
Name Type Attributes Description
dbName string <optional>

SlashDB database ID; if specified, will only return queries associated with the given database

Source:
Returns:

queries - a key/value pair object keyed by query ID, with
a corresponding SQLPassThruQuery object for each key

Type
object

(async) getQueryDef(dbNameopt, guiDataopt) → {object}

Returns configuration info about SlashDB queries

Parameters:
Name Type Attributes Description
dbName string | undefined <optional>

SlashDB ID of query to filter on; leave empty to retrieve all databases

guiData boolean <optional>

returns additional info normally available in the GUI view when set to true

Source:
Returns:

containing configuration info for all or selected queries

Type
object

(async) getReflectStatus(dbNameopt) → {object}

Returns current status of SlashDB connection to database

Parameters:
Name Type Attributes Description
dbName string | undefined <optional>

SlashDB ID of database to filter on; leave empty to retrieve all databases

Source:
Returns:

containing database connection status for all or selected databases

Type
object

(async) getSettings() → {object}

Retrieves host's SlashDB configuration info

Source:
Returns:

containing SlashDB configuration items

Type
object

(async) getUser(usernameopt) → {object}

Returns configuration info about SlashDB users

Parameters:
Name Type Attributes Description
username string | undefined <optional>

SlashDB ID of user to filter on; leave empty to retrieve all users

Source:
Returns:

containing configuration info for all or selected users

Type
object

(async) getVersion() → {string}

Retrieves SlashDB version number

Source:
Returns:

containing SlashDB version number

Type
string

(async) isAuthenticated() → {boolean}

Checks whether SlashDB client is authenticated against instance.

Source:
Returns:

boolean - to indicate if currently authenticated

Type
boolean

(async) loadModel(dbNameopt) → {object}

Enables connection to a database configured on SlashDB host

Parameters:
Name Type Attributes Description
dbName string <optional>

SlashDB ID of database to connect

Source:
Returns:

containing database configuration info and connection status

Type
object

(async) login(username, password) → {true}

Logs in to SlashDB instance. Only required when using username/password based crendentials. if not provided will try SSO login.

Parameters:
Name Type Description
username string

optional username to use when connecting to SlashDB instance using password based login

password string

optional password associated with username

Source:
Throws:

on invalid login or error in login process

Type
Error
Returns:

true - on successful login

Type
true

(async) loginSSO(popUp)

Logs in to SlashDB instance. Only required when using SSO.

Parameters:
Name Type Description
popUp boolean

optional flag to sign in against the identity provider with a Pop Up window (false by default)

Source:

(async) logout()

Logs out of SlashDB instance

Source:

(async) refreshSSOToken()

Refreshes the SSO access token.

Source:

(async) unloadModel(dbNameopt) → {object}

Disables connection to a database configured on SlashDB host

Parameters:
Name Type Attributes Description
dbName string <optional>

SlashDB ID of database to disconnect

Source:
Returns:

containing database configuration info and connection status

Type
object

(async) updateSSO(sso)

Updates a SlashDB client instance SSO settings.

Parameters:
Name Type Description
sso Object

optional settings to login with Single Sign-On

Properties
Name Type Description
idpId string

optional identity provider id configured in SlashDB

redirectUri string

optional redirect uri to redirect browser after sign in

popUp boolean

optional flag to sign in against the identity provider with a Pop Up window (false by default)

Source: