Want to deploy your JVM, Node.js and Go apps effortlessly to AWS? Try our service Boxfuse

HSQLDB

Supported Versions

  • 2.4
  • 2.3
  • 2.2
  • 2.0
  • 1.8 Flyway Enterprise

Driver

HSQLDB
Supported versions 1.8 and later
URL format jdbc:hsqldb:file:file
Ships with Flyway Command-line Yes
Maven Central coordinates org.hsqldb:hsqldb:1.4.196
Default Java class org.hsqldb.jdbcDriver

SQL Script Syntax

Compatibility

  • DDL exported by HSQLDB can be used unchanged in a Flyway migration
  • Any HSQLDB SQL script executed by Flyway, can be executed by the Hsql tools (after the placeholders have been replaced)

Example

/* Single line comment */
CREATE TABLE test_data (
  value VARCHAR(25) NOT NULL PRIMARY KEY
);

/*
Multi-line
comment
*/

-- Sql-style comment

-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');

CREATE TRIGGER uniqueidx_trigger BEFORE INSERT ON usertable
	REFERENCING NEW ROW AS newrow
    FOR EACH ROW WHEN (newrow.name is not null)
	BEGIN ATOMIC
      IF EXISTS (SELECT * FROM usertable WHERE usertable.name = newrow.name) THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'duplicate name';
      END IF;
    END;

Limitations

  • No concurrent migration support (to make Flyway cluster-safe) with HSQLDB 1.8, as this version does not properly support SELECT ... FOR UPDATE locking

Derby