Git Integration Procedures
The CData Virtuality Server supports Git integration enabling you to set up and use Git as a version control system if you want a convenient way to record changes to CData Virtuality objects.
Currently supported list of objects:
Data sources
Views
Procedures
Remarks
Roles
Permissions
Users
Jobs
Schedules of type
INTERVAL
,CRON
, andCHAINED
Default options
Data catalog attributes
Publications
Optimizations
Recommended indexes
Recommended optimization symbols
Materialized tables
Queue handlers
SYSADMIN.gitInit
This procedure initiates a local Git repository with the server objects as its content.
CALL "SYSADMIN.gitInit"(
"repoFolder" => '/some/file/path'
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | System path where the repository will be initialized |
| Out | string | No | Result of the operation |
When importing a large amount of jobs and schedules it is recommended to initiate Git repository after the import to make schedules.sql file creation faster.
SYSADMIN.gitCheckout
This procedure switches the branch or tag on which Git is working and informs about the result.
-- With branch
CALL "SYSADMIN.gitCheckout"(
"branch" => 'branchName'
);;
-- With tag
CALL "SYSADMIN.gitCheckout"(
"tag" => '1.0.0'
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | Yes | Branch name Git will use. If omitted, the procedure will return the current branch |
| In | string | Yes | The tag name to checkout. It is mutually exclusive with a branch parameter. When doing a checkout of a tag, it is recommended to avoid creating new objects in the server |
| Out | string | No | Result of the operation if |
SYSADMIN.gitClone
This procedure performs a “git clone” with the specified parameters.
CALL "SYSADMIN.gitClone"(
"remoteUrl" => 'git @ remote-url.com:user/repo.git', "repoFolder" => '/some/file/path',
"sshKeyId" => 1,
"branchToCheckout" => 'branchName'
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | URL of the remote repository in the SSH format (usually git @ remote- url.com:user/repo.git) |
| In | string | No | System path the repo should be cloned into |
| In | integer | No | SSH key ID to be used as authentication in the remote repository. See documentation for the |
| In | string | Yes | Branch to be checked out. If omitted, the master branch will be used |
| Out | string | No | Result of the operation |
SYSADMIN.gitExclude
This procedure specifies a comma-separated list of objects or object name patterns that should be excluded during Git integration operations.
If replaceInsteadOfAppend
is set to FALSE
(default), the procedure appends the pattern or object name from the objectOrPattern
value to the existing list of exclusions; otherwise, replaces it.
CALL "SYSADMIN.gitExclude"(
"objectOrPattern" => 'view:views.v1, procedure:views.proc_%',
"replaceInsteadOfAppend" => true
);;
It has the following parameters:
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | The object name(s) or pattern(s) (SQL LIKE) to be excluded during Git integration operations. Should be provided as a comma-separated list of values in the following format: |
| In | string | Yes | Changes the behaviour from appending new patterns to replacing the current exclude list with the |
| Out | string | No | Result of the operation |
List of patterns for available objects:
DataSource
Schema
View
Procedure
Remark
Role
User
Permission
Job
Default Option
Schedule
Data Catalog Attribute
Queue Handler
Optimization
Recommended Index
Web Business Data Shop (name of the published object, could be found in the
SYSADMIN.WebBusinessDataShopPublished
table)
Support for roles, users, permissions, jobs (SQLJob
, CopyOverSQLJob
, createCopyOverSourceTableJob
), schedules, remarks, data catalog attributes, and publications is available since v4.0.5
Support for optimizations, recommended indexes, recommended optimization symbols, queue handlers, jobs (full support), and schedules (full support) is available since v4.1
SYSADMIN.purgeObjects
This procedure purges objects from the server depending on the provided list of object types.
CALL "SYSADMIN.purgeObjects"(
"objectTypes" => 'views,procedures',
"dryRun" => false,
"ignorePurgeInGit" => true,
"bypassGitExclude" => true
);;
It has the following parameters:
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | Yes | Filter objects to be purge by type in CSV format. Default: Supported values: datasources, default options, schemas, procedures, views, optimizations, remarks, roles, permissions, users, queue handlers, jobs, optimization jobs, copy over table jobs, copy over sql jobs, gather statistics jobs, backup jobs, recommended indexes, schedules, web business data shops, data catalog attributes |
| In | boolean | Yes |
Default: |
| In | boolean | Yes | If set to Default: |
| In | boolean | Yes | If set to Default: |
| Out | string | No | Result of the operation |
The ignorePurgeInGit
and bypassGitExclude
parameters in the SYSADMIN.purgeObjects
procedure are available since v4.2
SYSADMIN.gitCommit
This procedure commits files to the local repository.
CALL "SYSADMIN.gitCommit"( "message" => 'Commit message',
"files" => Array('virtual_schema/views/create.sql')
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | Message to be used in the commit operation |
| In | string | Yes | Array-formatted list of files to be committed. If omitted, the entire repository is committed |
| Out | string | No | Result of the commit operation containing the commit hash ID |
SYSADMIN.gitStatus
This procedure returns a list of files and its Git status.
CALL "SYSADMIN.gitStatus"();;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| ResultsSet | string | No | Status of the given file. Options are |
| ResultsSet | string | No | Relative path of the file |
SYSADMIN.gitDiff
This procedure shows the Git diff of a given file.
CALL "SYSADMIN.gitDiff"(
"file" => 'virtual_schema/views/create.sql'
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | Individual file to check the differences for |
| Out | string | No | Output of git diff for the requested file |
SYSADMIN.gitFixConflict
This procedure fixes a Git conflict using git checkout --ours/theirs path-to-file, choosing between the local or remote version to fix the conflict.
CALL "SYSADMIN.gitFixConflict"(
"file" => 'virtual_schema/views/create.sql', "strategy" => 'OURS'
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | File to check |
| In | string | No | Strategy to fix the conflict. Accepted values are |
| Out | string | No | Result of the operation |
SYSADMIN.gitPull
This procedure performs a git pull origin
on the remote Git repository and will throw informative exceptions in case of partial success.
CALL "SYSADMIN.gitPull"();;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| Out | string | No | Result of the operation |
SYSADMIN.gitPush
This procedure performs a git push origin CURRENT_BRANCH
on the remote Git repository and will throw informative exceptions in case of partial success.
CALL "SYSADMIN.gitPush"("additionalProperties" => 'atomic=false');;"
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| Out | string | No | Result of the operation |
| In | string | Yes | Allows to disable/enable atomic flag in git push. Default value of atomic flag: |
The additionalProperties
parameter in the SYSADMIN.gitPush
procedure is available since v4.7
SYSADMIN.gitSetRemote
This procedure adds a remote for the current Git repository. It will communicate with the server to validate successful authentication in the remote repository.
CALL "SYSADMIN.gitSetRemote"(
"remoteUrl" => 'git @ remote-url.com:user/repo.git', "sshKeyId" => 1
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | URL of the remote repository in the SSH format (usually git@remote- url.com:user/repo.git) |
| In | integer | No | SSH key ID to be used as authentication in the remote repository. See documentation for the |
| Out | string | No | Result of the operation |
SYSADMIN.gitDeploy
This procedure reads the local Git repository and executes the SQL statements contained in the files in the CData Virtuality Server.
CALL "SYSADMIN.gitDeploy"( "dryRun" => 'true');;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | boolean | Yes | If set, no actual task is performed in the CData Virtuality Server. The procedure will iterate all files and try to parse the SQL statements, but will not execute them |
| Out | string | No | Result of the operation |
SYSADMIN.gitTag
This procedure creates a local tag pointing to the last commit in the repository.
CALL "SYSADMIN.gitTag"(
"name" => 'tag_name',
"message" => 'some message'
);;
It has the following parameters:
To view the full table, click the expand button in its top right corner
Parameter | In/Out | Type | Nullable? | Description |
---|---|---|---|---|
| In | string | No | Name of the tag (like ‘1.0.0’) |
| In | string | No | Description of the tag and its details |
| Out | string | No | Result of the operation |