Issue importing lookup list into H2 SQL data service

I’ve been experimenting with moving from docker Postgres test containers towards H2 in-memory tests. But I’m running into a syntax exception.

I think I’ve boiled it down to some generated SQL when importing the lookup lists first thing when setting up our schema.

class ExampleTest {

  @Test
  void testH2LookupListImport() {
    EventServiceLocal eventService = EventServiceLocal.newBuilder().build();

    DataServiceSql dataServiceSql = DataServiceSql.newBuilder(eventService).build();

    dataServiceSql.upsertResources(new ExampleResources(), Context.makeSystemContext());

    ILookupListService lookupListService = dataServiceSql.getLookupListService();
    Set<LookupList> lookupLists = lookupListService.loadAll(Context.makeSystemContext());

    assertThat(lookupLists, Matchers.not(Matchers.empty()));
  }

  @NoArgsConstructor
  public static class ExampleResources implements IResourceDescriptor {

    @Override
    public Optional<String> getLookupListLocation() {
      return Optional.of("/exampleTest/lookuplists");
    }
  }
}

And here is the example lookup list I could still get to error out.

<Lookup>
    <LookupList name="MyLookupList">
        <item value= "A" />
        <item value= "B" />
        <item value= "C" />
    </LookupList>
</Lookup>

I was able to get H2 to save to a file, and so was able to connect to it with my client locally. From what I can tell, the ‘LookupListItem’ table does not exist.

It appears to be from the attempt to load by ID used here: SqlDaoHelper::doLoadBatchByIdentifiersIfExists

LEAF version 3.12

Hi Kai! Sorry for the delay. We’ll take a look at this and get back to you soon.

Hi Kai, what version of H2 are you using? LEAF does not support H2 2.x versions and the version we currently support for testing only is 1.4.200 since H2 1.x has vulnerabilities that should not be used in production.

Sorry, I put this ticket on the back burner.
I found my stash and tried it out with the 1.4.200 version of H2 and it worked.
Thank you for pointing that out.