Skip to content

electric-cloud-community/EC-DBI

Repository files navigation

Perl DBI plugin

The Perl DBI module is a simple Perl database interface used to execute queries. The Perl DBI module executes a query through an appropriate database driver (DBD) module.

A DBD module has the required libraries needed to communicate to a database. When you use the Perl DBI module to make a query, it sends the query to the corresponding DBD module to communicate directly to the database.

With the EC-DBI plugin, you can:

  • Execute SQL scripts from SQL files or from the text area in the parameter form.
  • Create backups for your databases.

The plugin executes the SQL code against databases by using the Perl DBI module, which means that you must install the corresponding DBD module. DBD-mysql and DBD-ODBC are installed by default, which means that you can access MYSQL and SQL Server or any preconfigured ODBC connection by default. Additional DBD Modules are required for Oracle, Postgres, and SQLite. Additionally, it can back up databases by calling command-line tools for almost every database type. For example, MySQL uses mysqldump, SQL Server uses osql, Oracle uses exp, and Postgres usespg_dump.

This plugin can communicate with the following databases:

  • SQL Server (through ODBC) 2008
  • MySQL 5.5
  • Oracle 9.2 or later
  • SQLite 3.7.7
  • Postgres 8.4 or later

Perl DBI links

More information can be found in the Perl DBI documentation.

Perl DBD links

Perl DBD modules can be found in the CPAN documentation.

Setting up the plugin configuration

For all parameter descriptions below, required parameters are shown in bold italics.

Plugin configurations

Plugin configurations are sets of parameters that can be applied across some, or all, of the plugin procedures. They can reduce the repetition of common values, create predefined parameter sets, and securely store credentials. Each configuration is given a unique name that is entered in the designated parameter for the plugin procedures that use them.

Plugin configuration parameters

Parameter Description

Configuration Name

Provide a unique name for the configuration. (Required)

User Name

Provide the user login ID for your database connection. (Required)

Password

Provide the user-specified password. (Required)

Plugin procedures

ExecuteQuery

This procedure creates a database connection through the Perl DBI module and a Perl DBD module to execute an SQL statement against the corresponding database.

You can access any database indirectly by using a preconfigured ODBC.

Additional Perl modules are required for the following databases:

Database Module name CPAN reference

Oracle

DBD-Oracle

DBD-Oracle at CPAN

SQLite

DBD-SQLite

DBD-SQLite at CPAN

Postgres

DBD-Pg

DBD-Pg at CPAN

Parameter Description

Database engine

Choose the database engine you want to connect to. Available options are: SQLServer, MySql, Oracle, Sqlite, Postgres, or an ODBC connection to any database. (Required)

Database name

The name of the database you want to use. (Required)

Server

Database server name. (Required)

Port

Database port. Common default ports are:

  • 3306 (Mysql)

  • 1433 (SQLServer)

  • 1521 (Oracle)

  • 5432 (Postgres)

Enable transactions

If checked, this option protects your data in case of errors.

Display format

Choose a display format. (Required)

Sql query

The query to run against the database.

Sql file

Absolute path to a SQL script.

Configuration name

Name of the configuration that contains the database user and password. (Required)

Result (output property path)

Property name used to store the result of queries.

BackUpDB

Creates a backup for the specified database.

Parameter Description

Database engine

Choose the database engine you want to connect to. Available options are: SQLServer, MySql, Oracle, Postgres and Sqlite. (Required)

Command Line Utility

Absolute path to a backup command utility. (Required):

  • mysqldump (Mysql)

  • osql (SQLServer)

  • exp (Oracle)

  • pg_dump (Postgres)

Database name

The name of the database to back up. (Required)

Server

Database server name.

Port

Database port. Some of the default ports are:

  • 3306 (Mysql)

  • 1433 (SQLServer)

  • 1521 (Oracle)

  • 5432 (Postgres)

Configuration name

Name of the configuration that contains the database user and password. (Required)

Name of the backup file

Name of the backup file (without extension). If you leave the field blank, the file name is "backup".

Destination path

The path where you want to store your backup file. (Required)

Examples and use cases

The following example shows how to create a configuration:

screenshot

The following example shows a list of server configurations:

screenshot

The following example shows a completed ExecuteQuery parameter form:

screenshot

The following example shows output for ExecuteQuery:

screenshot

The following example shows a completed MySql backup parameter form:

screenshot

The following example shows output for a MySQL backup:

screenshot

The following example shows a completed Oracle backup parameter form:

screenshot

The following example shows output for an Oracle backup:

screenshot

The following example shows a completed SQL Server backup parameter form:

screenshot

The following example shows output for a SQL Server backup:

screenshot

Release notes

EC-DBI 2.0.4

  • The documentation has been migrated to the main documentation site.

EC-DBI 2.0.3

  • Added metadata that is required for 9.0 release.

EC-DBI 2.0.2

  • Fixed issue with configurations being cached for Internet Explorer®.

EC-DBI 2.0.1

  • ElectricCommander was renamed to CloudBees.

EC-DBI 2.0.0

  • The result (output property path) parameter was added.

  • JSON and XML formats for results were added.

EC-DBI 1.0.2

  • Procedure names were changed in the step picker section.

EC-DBI 1.0.1

  • XML parameter panels were added.

  • The Help page was updated.

EC-DBI 1.0.0

  • Initial release.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published