Skip to main content
Skip table of contents

Git Integration - Preview Feature

You are looking at an older version of the documentation. The latest version is found here.

Starting from version 2.4, the Data Virtuality Server enables you to set up and use git as a version control system if you want a convenient way to record changes to data sources, views, procedures, users, roles, etc. and browse history.

Please note that for now, this is a preview feature with limited functions. This first version is more like a log of changes in the system, making it easy to see what was done and by whom - it may be handy, for example, in case you need to investigate an issue and understand what caused it.

Further full implementation of Git integration is currently underway. Please feel free to share your thoughts and suggestions - we are looking forward to hearing your feedback!

Setup

Pre-requisites

  • Git command-line client is required (only for the initial setup, it can be removed after it is completed);
  • Data Virtuality Server should already have SSH access to the origin;
  • The origin's fingerprint must already be in known_hosts (for *nix systems).

Repository Setup

You can set up your repository by cloning an existing repository or by creating a new one.

Here is how to create a new repository:

  1. Create a new directory (in our example, /opt/datavirtuality/git_repository).
  2. Initialize it:
BASH
cd /opt/datavirtuality/git_repository && git init

Data Virtuality Server Setup

After you have set up your repository, configure the repository path in the Data Virtuality Server by running the following command (please remember to change the value  val to reflect your configuration):

SQL
CALL "SYSADMIN.setDefaultOptionValue"(
	"opt" => 'GIT_INTEGRATION_PATH',
	"val" => '/opt/datavirtuality/git_repository'
);;

Git integration will become active as soon as this command is executed. If you need to disable git integration, set val to an empty string:

SQL
CALL "SYSADMIN.setDefaultOptionValue"( 
    "opt" => 'GIT_INTEGRATION_PATH', 
    "val" => '' 
);;

To create an initial copy of your system in the repository, you can use the following command:

SQL
CALL "SYSADMIN.gitIntegrationDumpSystem"();;

By default, the Git Integration functionality in Data Virtuality only "commits" changes without pushing them to the repository. You can create a job to run a git push automatically and periodically using this command:

SQL
CALL "SYSADMIN.gitIntegrationActivatePushJob"();;

Once executed, this command will add a new system job that will perform a regular {{git push origin}} according to the schedule. By default, the job is scheduled to run every hour, but you can change this in the Data Virtuality Studio like a regular schedule.

By default, the Data Virtuality Server initializes and uses a local repository. The main repository can be changed to point to a remote repository instead of a local one by running the git add remote... command directly on the Server.

Please note that at the moment, using multiple branches is not possible, and only master is available.

Using Git Integration

Repository Layout

This is how the folder structure created by the Data Virtuality Server looks:

CODE
./git_repository
	datasources
	jobs
	optimizations
	roles
	users
	virtual_schemas
    	X_Utilities
			procedures
			views

Viewing Commit History

You can view the commit history of the repository using the git log command. Here's how to use this command and an example output:

CODE
cd /opt/datavirtuality/git_repository
git log

[root@cwk git_repository]# git log
commit fc158b3626eef138ebca8bf9175f4789fb561464 (HEAD -> master)
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:41:54 2021 -0500

    Schedule 07553f64-e39d-11eb-8913-000c29d28463 has been created.

commit 83f8715867bff5c9669879c42f4f4fd9976f93a2
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:41:53 2021 -0500

    Job git-push-job has been created.

commit 7de54e75d841781da5d433418bca2cc9cf5c7e74
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:37:43 2021 -0500

    Schedule 718d6fc3-e39c-11eb-8913-000c29d28463 has been created.

commit f665cb7611d10bb047cd950e4c7307a90907a3ac
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:37:42 2021 -0500

    Job git-push-job has been created.

commit 0c3268de90f52ff0efdbf8a78233a4efd1e9ed8f
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:37:21 2021 -0500

    Schedule 638e8532-e39c-11eb-8913-000c29d28463 has been created.

commit d16569bab74b780c3b03e00b075167ce18c09074
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:37:20 2021 -0500

    Job git-push-job has been created.

commit 751cc0551a3abdf4ccb7ec8636db9d30cc99d92b
Author: admin <admin@datavirtuality>
Date:   Tue Jul 13 00:35:01 2021 -0500

    Git Integration System Dump

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.