Skip to content

mandragorn/dbDiff

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About
========

Database Diff Tool is a library for comparing database schemas.

Features
========
  - Can compare differences between database schemas:
    - Missing or unexpected tables
    - Missing or unexpected columns
    - Checks and compares column names, types, nullability, defaults, and sizes
    - Missing or unexpected foreign keys
    - Missing or unexpected primary keys/indices/unique constraints
  - Database Independent
    - Uses JDBC MetaData class -- as long as you have a JDBC driver and a solid MetaData implementation, you should be fine.
  - Supports Hibernate
    - Can compare Hibernate configuration with a live database schema

Usage
========

Briefly, there are two programs:
 1) com.vecna.dbDiff.tools.MakeReferenceDatabase
    - Use this tool to create a new reference database file. 
      - The db file is a serialized version of the internal program db model class. 
    - The file to be created is specified with a command-line argument. By default, it is 'myDb.ser'.
    - Refer to main method's javadoc for parameters to supply (eg DB connection params)
 2) com.vecna.dbDiff.tools.CompareDatabase
    - Use this tool to read in a reference db file created by the first program and compare a live DB to it
    - Specify db connection params for the to-be-tested db using command line (refer to javadoc for paramaters to supply)
    - Any database differences are output to the console in human-readable results

The easiest way to run these tools is to load this project in Eclipse, open up those two classes, hit Run Configurations, supply the appropriate arguments in the Arguments tab (eg db url, username, and password), and then run it from inside Eclipse. You will need the JDBC driver on the classpath.

Credits
=======

Originally developed by Vecna Technologies, Inc. and open sourced as part of its community service program. See the LICENSE file for more details.
Vecna Technologies encourages employees to give 10% of their paid working time to community service projects. 
To learn more about Vecna Technologies, its products and community service programs, please visit http://www.vecna.com.

About

Database schema diff tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published