CData Virtuality Server はGit integrationをサポートしており、CData Virtuality オブジェクトの変更を記録する便利な方法をお望みであれば、バージョン管理システムとして Git を設定して使用することができます。

現在サポートされているオブジェクトのリスト:

  • Data sources

  • Views

  • Procedures

  • Remarks

  • Roles

  • Permissions

  • Users

  • Jobs

  • INTERVALCRON、およびCHAINEDタイプのスケジュール

  • Default options

  • Data catalog attributes

  • Publications

  • Optimizations

  • Recommended indexes

  • Recommended optimization symbols

  • Materialized tables

  • Queue handlers

SYSADMIN.gitInit

このプロシージャは、サーバーオブジェクトをコンテンツとするローカルの Git リポジトリを開始します。

CALL "SYSADMIN.gitInit"(
"repoFolder" => '/some/file/path'
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

repoFolder

In

string

No

System path where the repository will be initialized

result

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

このプロシージャは、Git が作業しているブランチやタグを切り替え、その結果を通知します。

-- With branch
CALL "SYSADMIN.gitCheckout"(
"branch" => 'branchName'
);;
 
-- With tag
CALL "SYSADMIN.gitCheckout"(
"tag" => '1.0.0'
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

branch

In

string

Yes

Branch name Git will use. If omitted, the procedure will return the current branch

tag

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

result

Out

string

No

Result of the operation if branch is set; current branch in case it is omitted

SYSADMIN.gitClone

このプロシージャは、指定したパラメータで「git clone」を実行します。

CALL "SYSADMIN.gitClone"(
"remoteUrl" => 'git @ remote-url.com:user/repo.git', "repoFolder" => '/some/file/path',
"sshKeyId" => 1,
"branchToCheckout" => 'branchName'
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

remoteUrl

In

string

No

URL of the remote repository in the SSH format (usually git @ remote- url.com:user/repo.git)

repoFolder

In

string

No

System path the repo should be cloned into

sshKeyId

In

integer

No

SSH key ID to be used as authentication in the remote repository. See documentation for the SYSADMIN_VDB.createSSHKeyPair procedure for SSH key generation

branchToCheckout

In

string

Yes

Branch to be checked out. If omitted, the master branch will be used

result

Out

string

No

Result of the operation

SYSADMIN.gitExclude

このプロシージャは、Git Integration の操作中に除外するオブジェクトやオブジェクト名のパターンをカンマ区切りで指定します。

replaceInsteadOfAppendFALSE(デフォルト)に設定されている場合、プロシージャはobjectOrPatternの値のパターンまたはオブジェクト名を既存の除外リストに追加し、そうでない場合は置き換えます。

CALL "SYSADMIN.gitExclude"(
"objectOrPattern" => 'view:views.v1, procedure:views.proc_%',
"replaceInsteadOfAppend" => true
);;

以下のパラメータがあります:

Parameter

In/Out

Type

Nullable?

Description

objectOrPattern

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: object_type:object_name. Object type and pattern values are case insensitive.

replaceInsteadOfAppend

In

string

Yes

Changes the behaviour from appending new patterns to replacing the current exclude list with the objectPattern parameter value. Default: FALSE

result

Out

string

No

Result of the operation

使用可能なオブジェクトのパターンのリスト:

  • DataSource

  • Schema

  • View

  • Procedure

  • Remark

  • Role

  • User

  • Permission

  • Job

  • Default Option

  • Schedule

  • Data Catalog Attribute

  • Queue Handler

  • Optimization

  • Recommended Index

  • Web Business Data Shop(SYSADMIN.WebBusinessDataShopPublishedテーブルにある公開オブジェクトの名前)

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

このプロシージャは、指定されたオブジェクトタイプのリストに応じて、サーバーからオブジェクトをパージします。

CALL "SYSADMIN.purgeObjects"(
"objectTypes" => 'views,procedures',
"dryRun" => false,
"ignorePurgeInGit" => true,
"bypassGitExclude" => true
);;

以下のパラメータがあります:

Parameter

In/Out

Type

Nullable?

Description

objectTypes

In

string

Yes

Filter objects to be purge by type in CSV format.

Default: all.

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, all jobs*, recommended indexes, schedules, web business data shops, data catalog attributes

(*) The all jobs value allows purging all deletable jobs in one call (optimization, copy over, gather statistics, custom backup jobs, etc).

dryRun

In

boolean

Yes

  • If set to TRUE, no change is done in the server but dry run of the operation is performed;

  • If set to FALSE, all objects are purged.

Default: TRUE

ignorePurgeInGit

In

boolean

Yes

If set to TRUE, purging of objects is not reflected on Git files.

Default: FALSE

bypassGitExclude

In

boolean

Yes

If set to TRUE, purgeObjects will ignore the gitExclude list.

Default: FALSE

result

Out

string

No

Result of the operation

The ignorePurgeInGit and bypassGitExclude parameters in the SYSADMIN.purgeObjects procedure available since v4.2

The 'all jobs' object type in the SYSADMIN.purgeObjects procedure available since v4.10

SYSADMIN.gitCommit

このプロシージャは、ローカルリポジトリにファイルをコミットします。

CALL "SYSADMIN.gitCommit"( "message" => 'Commit message',
"files" => Array('virtual_schema/views/create.sql')
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

message

In

string

No

Message to be used in the commit operation

files

In

string

Yes

Array-formatted list of files to be committed. If omitted, the entire repository is committed

result

Out

string

No

Result of the commit operation containing the commit hash ID

SYSADMIN.gitStatus

このプロシージャは、ファイルのリストとGit ステータスを返します。

CALL "SYSADMIN.gitStatus"();;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

status

ResultsSet

string

No

Status of the given file. Options are ADDED, CHANGED, REMOVED, MISSING, MODIFIED, UNTRACKED, and CONFLICTING

path

ResultsSet

string

No

Relative path of the file

SYSADMIN.gitDiff

このプロシージャは、指定したファイルのGit diff を表示します。

CALL "SYSADMIN.gitDiff"(
"file" => 'virtual_schema/views/create.sql'
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

file

In

string

No

Individual file to check the differences for

result

Out

string

No

Output of git diff for the requested file

SYSADMIN.gitFixConflict

このプロシージャは、git checkout --ours/theirs path-to-file を使ってGit の衝突を修正するもので、ローカル版かリモート版のどちらかを選んで衝突を修正します。

CALL "SYSADMIN.gitFixConflict"(
"file" => 'virtual_schema/views/create.sql', "strategy" => 'OURS'
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

file

In

string

No

File to check

strategy

In

string

No

Strategy to fix the conflict. Accepted values are OURS (to use the local file and discard remote changes) or THEIRS (to use the remote file and discard local changes)

result

Out

string

No

Result of the operation

SYSADMIN.gitPull

このプロシージャは、リモートの Git リポジトリに対してgit pull originを実行し、部分的に成功した場合は有益な例外をスローします。

CALL "SYSADMIN.gitPull"();;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

result

Out

string

No

Result of the operation

SYSADMIN.gitPush

このプロシージャは、リモートのGit リポジトリに対してgit push origin CURRENT_BRANCHを実行し、部分的に成功した場合は有益な例外をスローします。

CALL "SYSADMIN.gitPush"("additionalProperties" => 'atomic=false');;"

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

result

Out

string

No

Result of the operation

additionalProperties

In

string

Yes

Allows to disable/enable atomic flag in git push. Default value of atomic flag: TRUE

The additionalProperties parameter in the SYSADMIN.gitPushprocedure is available since v4.7

SYSADMIN.gitSetRemote

このプロシージャは、現在のGit リポジトリのリモートを追加します。リモートリポジトリで認証が成功したことを確認するためにサーバーと通信します。

CALL "SYSADMIN.gitSetRemote"(
"remoteUrl" => 'git @ remote-url.com:user/repo.git', "sshKeyId" => 1
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

remoteUrl

In

string

No

URL of the remote repository in the SSH format (usually git@remote- url.com:user/repo.git)

sshKeyId

In

integer

No

SSH key ID to be used as authentication in the remote repository. See documentation for the SYSADMIN_VDB.createSSHKeyPair procedure for SSH key generation

result

Out

string

No

Result of the operation

SYSADMIN.gitDeploy

このプロシージャはローカルのGit リポジトリを読み込み、CData Virtuality Server のファイルに含まれるSQL 文を実行します。

CALL "SYSADMIN.gitDeploy"( "dryRun" => 'true');;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

dryRun

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

result

Out

string

No

Result of the operation

SYSADMIN.gitTag

このプロシージャは、リポジトリの最後のコミットを指すローカルタグを作成します。

CALL "SYSADMIN.gitTag"(
"name" => 'tag_name',
"message" => 'some message'
);;

以下のパラメータがあります:

To view the full table, click the expand button in its top right corner

Parameter

In/Out

Type

Nullable?

Description

name

In

string

No

Name of the tag (like ‘1.0.0’)

message

In

string

No

Description of the tag and its details

result

Out

string

No

Result of the operation