Utilizing version control

myDBR offers a command line tool mydbr_sync which will extract myDBR reports and other objects to the local filesystem. This will allow you to change reports in the server and extract the changes to the local filesystem from where you can easily to put the files into your version control system. If you do not have direct access to the remote database you can use an SSH tunnel.

mydbr_sync is a java-program which requires Java 1.6 installed.

mydbr_sync separates different objects from mydbr-database and places them on separate directories. mydbr_sync will by default produce following file structure into the directory where it is run:

.
├── mydbr_sync.properties
└── mydbr
    └── default
        ├── functions
        ├── procedures
        ├── reports
        └── views

Usage

Go to the directory where you wish to extract mydbr-objects to. When you run mydbr_sync first time it will ask you the configuration parameters and create the configuration file mydbr_sync.properties. Once the configuration file exists you just run the mydbr_sync command.

java -jar mydbr_sync.jar [filename]

  • where [filename] is the name of a database configuration file (default:mydbr_sync.properties)
  • mydbr_sync will check if a configuration file exists and prompt for connection parameter to create one if needed

Sample configuration files

The user names and password must be the ones used in myDBR

for MySQL:

user=mydbr
pass=mydbr_pass
host=localhost
port=3306
database=mydbr_demo
db_type=mysql

for Microsoft SQL Server:

user=mydbr
pass=mydbr_pass
host=localhost
port=1433
database=mydbr_demo
db_type=mssql

for Sybase ASA:

user=mydbr
pass=mydbr_pass
host=172.16.125.139
port=5000
database=mydbr
db_type=sybase

Additional configuration settings

If you have a larger reporting structure and wish to separate different sub-projects into separate directories, you can define stored routine prefixes and define sub-folders for file storage make the definition in your database configuration file with the following syntax

Each prefix is defined by prefix / subdir pairs:

prefix.your_id=your_routine_prefix

subdir.your_id=your_sub_folder_name

Additional definitions into mydbr_sync.properties:

prefix.1=sp_DBR_sales
subdir.1=sales

prefix.2=sp_DBR_development
subdir.2=development

prefix.3=fn_sales
subdir.3=sales