Startup script to create a schema in HSQLDB

后端 未结 2 1102
一整个雨季
一整个雨季 2021-01-04 22:32

I am attempting to use an in-memory database to mock out a teradata database. I need to create a schema before the tables are built, however, it is giving me fits.

<
2条回答
  •  借酒劲吻你
    2021-01-04 23:09

    You can use a file: database with all data in memory and without any change written by your test. This should serve your purpose.

    First create the database schema with the URL jdbc:hsqldb:file:initdata and perform SHUTDOWN. Then add files_readonly=true to the initdata.properties file or alternatively use the URL below:

    jdbc:hsqldb:file:initdata;files_readonly=true
    

    When your tests run against this database, nothing is written to database files and all data is in memory.

提交回复
热议问题