# Custom views - support for h2 database?

**URL:** <https://forum.canton.network/t/custom-views-support-for-h2-database/6455>\
**Category:** App Development\
**Tags:** custom-views\
**Created:** [April 20, 2023, 5:11am UTC](https://forum.canton.network/t/custom-views-support-for-h2-database/6455 "2023-04-20T05:11:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![huw](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/huw/32/2343_2.png) [@huw](https://forum.canton.network/u/huw)\
**Post date:** [April 20, 2023, 5:11am UTC](https://forum.canton.network/t/custom-views-support-for-h2-database/6455/1 "2023-04-20T05:11:51Z")

</div>

I am looking to unit test my application which is using custom views. Will I have to test it using a postgres database or is it possible to use h2 in memory database?

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [April 20, 2023, 8:11am UTC](https://forum.canton.network/t/custom-views-support-for-h2-database/6455/2 "2023-04-20T08:11:44Z")

</div>

In principle right now they’re only tested internally using PostgreSQL. In practice, if this is for testing your application, using [H2 in PostgreSQL compatibility mode](https://www.h2database.com/html/features.html) _might_ be viable. However, you might expect additional bumps in the road to the ones that are already normally expected for early access features. Another possibility to test is to consider using the [Postgres module of Testcontainers](https://www.testcontainers.org/modules/databases/postgres/).

---

<div class="post-metadata">

**Author:** ![huw](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/huw/32/2343_2.png) [@huw](https://forum.canton.network/u/huw)\
**Post date:** [April 21, 2023, 1:58am UTC](https://forum.canton.network/t/custom-views-support-for-h2-database/6455/3 "2023-04-21T01:58:52Z")

</div>

Thanks @stefanobaghino-da . Looks like Testcontainers will do the job nicely.
