Command Line Interface
Execute SnowConvert via CLI
Quick start
To execute a conversion with the SnowConvert CLI you have to have an active access code. Currently, the access codes for the CLI are different than the UI, but if you already have an access code for the UI you should be able to reuse the same access code. In the section below we show how to install an access code.
There are several Command Line Arguments documented below, but the main ones are -i
for the input folder and -o
for the output folder.
Install an access code
To install an access code just execute SnowConvert CLI program with the install-ac
argument and the access code.
CLI useful commands
snowct --help or snowct -h
: Will show help.snowct --version or snowct -v
:
Will show the version of the CLI (and the code processors).snowct install-ac --access-code <access-code>:
Will install the corresponding access code provided.snowct install-ac --file <file-with-access-code>:
Will install the corresponding access code in the machine (using an access code file).snowct show-ac --platform <platform>:
Will show the active access code for a specific platform (Oracle, Teradata, SQL-server, scala, python).snowct {Language} -i ./input -o ./output:
Will convert the input code.Supported Languages: Teradata, Oracle, SQL-server.
snowct {Language} -i ./input -o ./output --assessment:
Will perform an assessment of the input code.You can check the help for a specific command just by using the -h or --help option. For example:
snowct install-ac --help
snowct show-ac --help
snowct teradata --help
Common CLI Arguments
The following arguments can be used in all the languages
-i, --input <PATH>
(Required)
-i, --input <PATH>
(Required)The path to the folder or file containing the input source code.
-o, --output <PATH>
(Required)
-o, --output <PATH>
(Required)The path to the output folder where the converted code and reports will be stored.
-a, --assessmentmode
-a, --assessmentmode
Flag to indicate whether or not to generate only Assessment files. By default, it's set to FALSE.
-t, --PLTargetLanguage <TARGET_LANGUAGE>
-t, --PLTargetLanguage <TARGET_LANGUAGE>
String value specifying the target language to convert Stored procedures and Macros. Currently supported are: SnowScript and JavaScript. The default value is set to SnowScript.
-e, --encoding <CODE PAGE>
-e, --encoding <CODE PAGE>
The encoding code page number is used for parsing the source files. We only accept encodings supported by .NET Core. Here are the ones supported at the moment:
Code Page | Name | Display Name |
1200 | utf-16 | Unicode |
1201D | unicodeFFFE | Unicode (Big endian) |
12000 | utf-32 | Unicode (UTF-32) |
12001 | utf-32BE | Unicode (UTF-32 Big endian) |
20127 | us-ascii | US-ASCII |
28591 | iso-8859-1 | Western European (ISO) |
65000 | utf-7 | Unicode (UTF-7). Not available in .NET 5 |
65001 | utf-8 | Unicode (UTF-8). Default encoding |
-s, --customschema <SCHEMA_NAME>
-s, --customschema <SCHEMA_NAME>
The string value specifies the custom schema name to apply. If not specified, the original database name will be used. Example: DB1.MyCustomSchema.Table1.
-d, --database <DB_NAME>
-d, --database <DB_NAME>
The string value specifies the custom database name to apply. Example: MyCustomDB.PUBLIC.Table1.
--useExistingNameQualification
This flag must be used in conjunction with the -d
or -s
parameters. When used, it preserves the existing name qualification from the input code when previous parameters are used.
Let's take a look at this example where -s newSchema
was included:
The same applies to databases.
--rate
--rate
The string value specifies the conversion rate mode. Currently supported are: LoC (Lines of Code) and Character. The default value is set to LoC.
-m, --comments
-m, --comments
Flag to indicate if the user wants to comment on nodes that have missing dependencies.
--disableEWIsGeneration
--disableEWIsGeneration
Flag to indicate whether EWIs comments (Errors, Warnings, and Issues) will not be generated on the converted code. The default is false.
License and Help
-l, --license [<LICENSE_KEY>]
-l, --license [<LICENSE_KEY>]
Shows the license information. If it's followed by a license key, it will attempt to download and install such a license. For example:
Showing license status
[
command] -l
Installing a license
[
command] -l 12345-ASDFG-67890
platform | command |
---|---|
Oracle | snowct-oracle |
SqlServer | snowct-sqlserver |
Teradata | snowct |
--terms
--terms
Show access code terms information.
--help
--help
Display the help information.
Additional Parameters
Each tool has its own optional parameters that you can provide in order to customize the conversion/assessment.
Visit the following links to read more about the additional parameters that are available for each tool:
Last updated