Skip to content

Library to compare and check SQL schemas

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

hschink/sql-schema-comparer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-schema-comparer

Build Status

Experimental library to compare and check SQL schemas and statements

Details

sql-schema-comparer allows to compare

  1. two SQL schemes with each other,
  2. a SQL statement with an SQL schema.

Therefor, sql-schema-comparer transforms SQL statements and database definitions into a graph representation. The graph representation is then used for comparison.

Frontends

sql-schema-comparer brings limited support for

  • Database Schema Parsing
  • H2 (Command-line not supported)
  • SQLite
  • SQL Statement Parsing
  • JPA (annotations)

Limitations

Two SQL schemes (databases) must only differ by one of the following transformations:

  • Table
  • Create
  • Drop
  • Rename
  • Column
  • Create
  • Drop
  • Rename
  • Move
  • Column Constraint
  • Create
  • Drop
  • Foreign Key Relation
  • Create
  • Drop

Usage

Please refer to the [unit tests] ut to get a detailed description of how to use the library in your code.

Eclipse Plug-In

If you want to know how sql-schema-comparer works within an IDE, have a look on the sql-schema-comparer eclipse plug-in.

Commandline Usage

The following examples assume that you created a stand-alone JAR.

Compare two SQLite database files

> java -jar sql-schema-comparer-standalone.jar file1.sqlite file2.sqlite

Compare an SQLite database file with an SQL statement

> java -jar sql-schema-comparer-standalone.jar -statement $STATEMENT file.sqlite

Development

If you like to join sql-schema-comparer development you may just want to use Eclipse IDE. Just use gradle's Eclipse plug-in with gradle eclipse to create the necessary Eclipse configuration files.

Happy programming! 😄

Stand-alone JAR

You create a stand-alone JAR with gradle: gradle standaloneJar. You'll find the JAR in build/libs.

License

"GNU LGPLv3" Apart from the SqlStatementFrontend.java the sql-schema-comparer is released under the terms of the LGPL.

"GNU GPLv3" Only the SqlStatementFrontend.java is released under the terms of the GPL.

About

Library to compare and check SQL schemas

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages