Skip to content

Work on the current change

alex-suv edited this page Jul 24, 2019 · 6 revisions

status

Show current status of db objects

usage: dbgit status [-h] [-v]
_
-h Show this help
-v Output full log of command execution

add

Add db objects into the DBGit index

usage: dbgit add <file_mask> [-h] [-v]
Examples:
dbgit add <SCHEME>/TEST_TABLE*
dbgit add <SCHEME>/TEST_VIEW.vw
-h Show this help
-v Output full log of command execution

reset

Reset current HEAD to the specified state

usage: dbgit reset [-soft | -mixed [-N] | -hard | -merge | -keep] [-h] [-hard] [-keep] [-merge] [-mixed] [-soft] [-v]
Examples:
dbgit reset
dbgit reset -hard
-h Show this help
-hard Reset HEAD, index and working tree
-keep Reset HEAD but keep local changes
-merge Reset HEAD, index and working tree
-mixed Reset only HEAD
-soft Reset HEAD and index
-v Output full log of command execution

rm

Remove objects from the DBGit index

usage: dbgit rm <object> [-db] [-h] [-v]
Example:
dbgit rm <object_name>
-db Remove objects from index and from database
-h Show this help
-v Output full log of command execution

restore

Restor db from the DBGit repository

usage: dbgit restore [-h] [-r] [-s <arg>] [-v]
Examples:
dbgit restore -s <file_name>
dbgit restore
-h Show this help
-r Update database
-s Save command restore to file
-v Output full log of command execution

This command doesn't change database by default, it creates sql file in <repo_folder>/.dbgit/scripts.
Add -r switch to make command change database.
Switch -s let you save sql script to a specific without of execution.

More Examples:

dbgit restore
dbgit restore -r
dbgit restore -s c:\temp\script.sql

dump

Dump db objects into the DBGit repository

usage: dbgit dump [-a] [-f] [-h] [-v]
Examples:
dbgit dump
dbgit dump -a
-a Add files to git
-f Dump all objects that exist in index even there didn't changes in database
-h Show this help
-v Output full log of command execution