private static IDBI createDataSource(TypeRegistry typeRegistry, File databaseDir, String name)
throws Exception
{
H2EmbeddedDataSourceConfig dataSourceConfig = new H2EmbeddedDataSourceConfig();
dataSourceConfig.setFilename(new File(databaseDir, name).getAbsolutePath());
H2EmbeddedDataSource dataSource = new H2EmbeddedDataSource(dataSourceConfig);
DBI dbi = new DBI(dataSource);
dbi.registerMapper(new TableColumnMapper(typeRegistry));
dbi.registerMapper(new ColumnMetadataMapper(typeRegistry));
dbi.registerMapper(new NativePartitionKey.Mapper(typeRegistry));