All Questions
Tagged with h2 playframework
65
questions
26votes
2answers
12kviews
Accessing play project database with h2-browser
I am having some trouble accessing the mem database via the h2-browser on a Play framework project.
With the configuration below, that I think is the correct one (apparently not!) I am getting a h2-...
14votes
1answer
12kviews
How to use a persistent H2 database in the Play Framework instead of in-memory
The H2 database used in the Java Todo List tutorial is the following:
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
How do I modify the configuration file to use a persistent ...
14votes
3answers
9kviews
Access mem or fs database tables using H2 console
I'm trying to access my application's tables in Play! Framework, but I can't find it using the console.
For instance, I have two entity models: Address and Campus.
I can create objects and save ...
10votes
3answers
15kviews
Resetting autoincrement in h2
I'm testing a controller that returns a json response but the tests
fail after the first time because the h2 database does not reset the
auto increment id.
Using fixtures or creating objects manually ...
9votes
4answers
8kviews
Unknown data type "JSONB" when running tests in play slick with H2 Database
I have evolution problem Unknown data type: "JSONB" when running tests in playframework using
playframework v2.6.6 for scala
play-slick v3.0.2
play-slick-evolutions v3.0.2
postgresql - 42.0.0
...
7votes
1answer
3kviews
Play! not shutting down H2 correctly
I'm using Play to write a webapp which is deployed in Tomcat. Because the app won't be processing very much data I'm using the default H2 database with Hibernate. When I want to deploy a new version ...
6votes
2answers
5kviews
How to connect to Play Framework in-memory database using JDBC?
I use the in-memory database that comes with Play Framework, when I have db=mem in the configuration file, for development.
How can I connect to this database using JDBC? and not the JPA that is the ...
6votes
1answer
1kviews
Play Framework Ebean BigDecimal fraction
I am using the Play Framework with Ebean and H2 database.
The problem is, the BigDecimal results in the DB script as:
sum decimal(38),
but what I want is:
sum ...
6votes
1answer
252views
How to check in Play Framework if a unit test performed a database insert/update/delete
I've got a base class that all my controller tests extend. This is set up so each unit test can have its own Fixture to load from.
So the @Before override will check what the required fixture for the ...
5votes
2answers
4kviews
How to access the development database with the Play! framework?
I want to see the tables of my Play! application with the H2 console, but all I see is a list of internal tables of the db engine. How can I view the tables of my application?
4votes
2answers
6kviews
How to fake ENUM columns in the H2 database for play unit testing?
I have a set of Play! unit tests that I have been running against an H2 database. I have added some enum columns to my model, and the tests now fail because of the sql statements used to create my ...
4votes
2answers
812views
In Play, can I apply different Evolutions depending on database type?
My Play application uses postgres. It includes some postgres-specific evolutions which prevents me from using an in-memory h2 database for testing. For example, the following evolution is fine in ...
4votes
2answers
515views
Play Framework: How do I change the sort order of my database?
I have a Play app with db=mem in my application.conf file, and I want to be able to set the database's collation to French, with strength set to primary. Any idea how to do this?
If I add
db.url=...
4votes
1answer
2kviews
Access Play framework's embedded H2 database when in production mode
Is there a way to access Play framework's embedded H2 database (db=fs in application.conf) when the application is in prod mode? (like with the /@db url, which doesn't work in this mode) I use Play ...
4votes
2answers
1kviews
Playframework evolutions files compatible with both postgres and h2
I've been developing a web site with the Play framework (scala) using H2 as a backend. Testing is nicely integrated, especially with the ability to run tests against an in-memory H2 db.
Now I'd like ...