Skip to content

Command Line Tool - Refactor

Refactor T-SQL script files using registered code refactorings.

Enlight refactor
--inputPath=<path>
--outputPath=<path>
--refactorings=<refactorings list>
[ --connectionString=<connectionString>
| --server=<servername> --database=<databasename> [ --user=<username> --password=<password> ] ]
Enlight refactor --list
ParameterDescription
connectionStringSQL connection string the target context database.
usernameUsername for accessing the database.
passwordSQL connection string.
databaseTarget database name.
serverTarget SQL Server name and instance name.
inputPathLocation 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.
outputPathRequired. Destination folder for the result files.
refactoringsRequired. A list of code names of refactorings.
listOutputs a list of all registered refactorings.

Build Machines edition specific parameters:

ParametersDescription
licenseDataRequired. License data or activation response file path.

Get a list of all available refactorings:

Enlight refactor --list

Run refactorings on script files:

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