Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AppVersion string
AppVersion stores version information from main
View Source
var RootCmd = &cobra.Command{
Use: "go-mssql-runner",
Short: "A script runner for MS SQL Server",
Long: `Runs a series of file-based SQL scripts on MS SQL Server.
A JSON configuration file is required. The configuration file should be
in the format:
{
"name": "A SQL Project",
"description": "This project runs a series of scripts to manipulate data",
"type": "Report",
"version": "1.0.0",
"scripts": {
"schema": [
"/schema/schema_script1.sql",
"/schema/schema_script2.sql"
],
"process": [
"/process/process_script1.sql",
"/process/process_script2.sql"
]
}
}
"schema" scripts contain DDL statements such as create table or create stored
procedure statements. Files should reside under a /schema folder relative to
the JSON configuration file.
"process" statements contain DML that run business logic. Files should reside
under a /process folder relative to the configuration file.
A "project" structure should look like:
/project-folder
mssqlrun.conf.json
/schema
schema_script1.sql
schema_script2.sql
/process
process_script1.sql
process_script2.sql
All scripts are run in the order they appear in their respective arrays. For
example, in the "schema" array, schema_script1.sql will be run before the
schema_script2.sql file.
WARNING: Do not place GO statements in the script files.
Connection information must be passed in via the command flags. For example:
go-mssql-runner start -c /path/configFile.json -u sqlUserName -p sqlPassword -s SQLServerHostName -d DatabaseName
`,
}
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.