Command Line Tool – Refactor

Refactor T-SQL script files using registered code refactorings.

This topic contains the following sections:

Usage
1Enlight refactor
2      --inputPath=<path>
3      --outputPath=<path>
4      --refactorings=<refactorings list>
5    [ --connectionString=<connectionString>
6      | --server=<servername> --database=<databasename> [ --user=<username>  --password=<password> ] ]

1Enlight refactor --list

Parameters

Parameter

Description

–connectionString

SQL connection string the target context database.

–username

Username for accessing the database.

–password

SQL connection string.

–database

Target database name.

–server

Target SQL Server name and instance name.

–inputPath

Location of the T-SQL script files. A list of files separated with semicolon can also be provided. The `-` prefix can be used to exclude specific files.

–outputPath

Required. Destination folder for the result files.

–refactorings

Required. A list of code names of refactorings.

–list

Outputs a list of all registered refactorings.

Build Machines edition specific parameters:

Parameters

Description

–licenseKey

Required. License key.

–licenseData

Required. License data or activation response file path.

Examples

Get a list of all available refactorings:

1Enlight refactor --list

Run refactorings on script files:

1Enlight refactor 
2        --inputPath="d:refactor target***.sql" 
3        --outputPath="d:refactor output" --refactorings=RE0001,RE0002,RE0006