Skip to content

Set up H2 in-memory database for development and testing with directory instructions #10

@merxgrc

Description

@merxgrc

Summary:
Set up H2 as an in-memory database for the Java Spring API project to facilitate easier development and testing.

Tasks:

  • Add the H2 database dependency to the pom.xml file in the project's root directory.
  • Configure the H2 database settings by editing the src/main/resources/application-dev.properties and src/main/resources/application-test.properties files. Add the following properties:
    spring.datasource.url=jdbc:h2:mem:testdb
    spring.datasource.driverClassName=org.h2.Driver
    spring.datasource.username=sa
    spring.datasource.password=
    spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
    spring.h2.console.enabled=true
  • Make sure the H2 console is enabled and accessible at /h2-console for dev and test profiles.
  • Update the DEV_README.md with a new section titled "Development Database" that explains how to use the H2 database and access the console.

Acceptance Criteria:

  • The application starts with H2 in-memory database for dev and test profiles.
  • The H2 console is accessible via browser at /h2-console.
  • Instructions for usage are clear in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions