In Spring Boot project I am trying to see in-memory tables from my IDE.
How to access in-memory h2 database from Intellij IDEA.
Here is a snippet from my application.yml:
h2:
datasource:
url: jdbc:h2:mem:mydb
username: username
password: 123
driver-class-name: org.h2.Driver
init-sql: h2.sql
console:
enabled: true
path: /search/console
settings:
trace: false
web-allow-others: false
Intellij has no field to input username for in-memory database:
Test Connection shows success, however it doesn't see tables from h2.sql.
I can access them using h2 console.
By the default, IntellJ doesn't show any of database.
right click
at the datasource
then choose Properties
Schemas
tab, you'll see a list of options
to choose which database
should be shown (I normally choose All databases
). Choose the database
which you need it to be shownThe result:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With