Skip to content

andrewparmet/mysql2h2-converter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mysql2h2-converter

A MySQL to H2 SQL conversion library written in Java.

Parse a MySQL dump and convert it to H2 statements either as an embedded library or as a standalone tool.

Next steps can include:

Other ideas:

Usage

As a library:

private static void convertAndCreate(Statement stmt, String sqlDump) throws SQLException, ParseException {
    Iterator<SqlStatement> sourceIterator = SQLParserManager.parseScript(new StringReader(sqlDump));
    Iterator<SqlStatement> converted = H2Converter.convertScript(sourceIterator);
    while (converted.hasNext()) {
        stmt.execute(converted.next().toString());
    }
}

On the command line:

java -jar lib/mysql2h2.jar demos/disconf-mysql.sql

Building

mvn install will generate the SQL parser and build an executable JAR.

License

This code is provided under the MIT license.

About

A MySQL to H2 SQL conversion library written in Java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%