Source

sqldump /

Filename Size Date modified Message
doc
src
src_castor
src_diff
src_graphml
src_mondrian
src_run
src_test
src_xtra
test
769 B
95 B
383 B
5.5 KB
874 B
414 B
7.8 KB
5.0 KB
851 B
1002 B
364 B
347 B
16.5 KB
1.6 KB

SQLDump

Utility to dump schema and data from a RDBMS. Features:

  • Does schema-dumping, using (mainly) standard java API, by way of java.sql.DatabaseMetaData
  • Does data-dumping (formats: csv, xml, html, json, sql 'insert into', sql 'update by PK', fixed column size, blob)
  • Can be used with any JDBC-compliant databases
  • Generates Entity-Relationship diagrams based on Tables and FKs (graphML output - yEd recommended)
  • Flexible schema output patterns (based on schema name, object type and object name)
  • Translation of metadata (column types) between different RDBMS dialects/implementations (partial)

SQLDump also has two subprojects:

Author: Telmo Brugnara <tbrugz@gmail.com>

License: AGPLv3

SQLDump - Basic Process

SQLDump processing consists of:

  1. 1 Grabber (implementation of SchemaModelGrabber, grabs a SchemaModel)
  2. 'n' Processors (implementation of AbstractSQLProc, usually uses a Connection)
  3. 'n' Dumpers (implementation of SchemaModelDumper, dumps a SchemaModel)

Grabber can be:

  • JDBCSchemaGrabber - Grabs schema metadata from a JDBC connection
  • JAXBSchemaXMLSerializer - Grabs schema metadata from a XML file

Processors can be:

  • DataDump - Dumps data based on grabbed schema (can partition data from 1 table in different files, can dump in different formats)
  • SQLQueries - Dumps data based on SQL-queries (same as DataDump - for each query)
  • graph.ResultSet2GraphML - Dumps a graphML diagram based on a SQL-query
  • SQLDialectTransformer - Transforms schema models between different sql-dialects

Dumpers can be:

  • SchemaModelScriptDumper - Dumps schema model in SQL-script format (DDL)
  • JAXBSchemaXMLSerializer - Dumps a XML representation of the schema model
  • graph.Schema2GraphML - Generates a Entity-Relationship diagram based on schema model
  • mondrianschema.MondrianSchemaDumper - Generates a Star/Snowflake Mondrian Schema based on schema model
  • xtradumpers.AlterSchemaSuggester - Generates suggestions of SQL-scripts for altering the schema model (beta)

All processing is controlled by a properties file. See sqldump.template.properties for more info.

Dependencies

Usage (with sources & ant)

  • Run (with ivy) ant resolve-ivy or (without ivy) ant resolve-get
  • Run ant compile
  • Copy sqldump.template.properties to sqldump.properties
  • Edit sqldump.properties
  • Copy build.template.properties to build.properties
  • Edit build.properties
  • Run ant run

Usage (with sources, without ant)

  • Download dependencies to /lib
  • Copy sqldump.template.properties to sqldump.properties
  • Edit sqldump.properties
  • Compile sources into bin
  • Run tbrugz.sqldump.SQLDump, e.g., java -cp bin;lib/kmlutils.jar;lib/commons-logging-1.1.1.jar;lib/log4j-1.2.15.jar;<jdbc-driver-path> tbrugz.sqldump.SQLDump <options>

Usage (without sources)

  • Download sqldump.jar jar from sqldump/downloads (may be outdated)
  • Download all jars from sqldump/lib to lib
  • (windows) Download sqldump.bat.template as sqldump.bat or (unix-like) download sqldump.sh.template as sqldump.sh
  • Download latest version of sqldump.template.properties as sqldump.properties
  • Download jdbc jars for your database of choice
  • Edit sqldump.properties and (windows) sqldump.bat or (unix-like) sqldump.sh (you may include command-line options at end)
  • (windows) Run sqldump.bat
  • (unix-like) Run sqldump.sh or run tbrugz.sqldump.SQLDump, e.g., java -cp sqldump.jar:lib/kmlutils.jar:lib/commons-logging-1.1.1.jar:lib/log4j-1.2.15.jar:<jdbc-driver-path> tbrugz.sqldump.SQLDump <options>

Command-line options

  • -propfile=<path-to-prop-file>: loads a different config properties file
  • -usesysprop: loads system properties besides the config file properties
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.