Function: SQL Database Add

by Simon Sparks · 4 February 2026

To use this function add it to the class library file named OrchestratorPluginSQLService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorPluginSQLService.ts

Description: Orchestrator Function to Add an SQL Database

Public Function: SQLDatabaseAdd

public SQLDatabaseAdd(strName: string, strType: string, strConnectionURL: string, strUusername: string, strPassword: string, strSessionMode: string): SQLDatabase {
    try {
        let objSQLDatabase: SQLDatabase = new SQLDatabase();
        objSQLDatabase.name = strName;
        objSQLDatabase.type = strType;
        objSQLDatabase.connectionURL = strConnectionURL;
        objSQLDatabase.username = strUusername;
        objSQLDatabase.password = strPassword;
        objSQLDatabase.sessionMode = strSessionMode;

        objSQLDatabase = SQLDatabaseManager.addDatabase(objSQLDatabase);

        this.objLogger.info(`Database object added: ${objSQLDatabase}.`);

        this.objLogger.info(`SQLDatabase Create of: ${strName} Successfull.`);

        return objSQLDatabase;
    }
    catch (objException) {
        this.objLogger.info(`SQLDatabase Create of: ${strName} Failed.`);

        return null;
    }
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like