---
title: "Discussion on \"A Better Way To Run Integration Tests With Prisma and PostgresQL\" | Hashnode"
description: "Discussion on \"A Better Way To Run Integration Tests With Prisma and PostgresQL\". Prisma, the TypeScript ORM, has taken the development community by storm. It provides a fully type-safe interface with PostgresQL (and other SQL and no-SQL DBMS) which makes it a no-brainer for us to use at ludicrous.\nThe Prisma team recently release..."
url: "https://hashnode.com/posts/a-better-way-to-run-integration-tests-with-prisma-and-postgresql/61569b8c28ed304eb1d80953"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [A Better Way To Run Integration Tests With Prisma and PostgresQL](https://ludicrous-blog-archive.hashnode.dev/a-better-way-to-run-integration-tests-with-prisma-and-postgresql?utm_source=hashnode&utm_medium=feed)

Prisma, the TypeScript ORM, has taken the development community by storm. It provides a fully type-safe interface with PostgresQL (and other SQL and no-SQL DBMS) which makes it a no-brainer for us to use at ludicrous. The Prisma team recently release...

Oct 1, 2021 · 6 min read · ludicrous-blog-archive.hashnode.dev  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#databases](https://hashnode.com/tag/databases)

## Written by

[the ludicrous blog](https://hashnode.com/@ludicrous)

@ludicrous

  
[View profile](https://hashnode.com/@ludicrous)

## Responses 1

Markdown supported · ⌘↵ to post

[Nemanja Mitic](https://hashnode.com/@nemanjam)

[Apr 24, 2022](https://hashnode.com/posts/a-better-way-to-run-integration-tests-with-prisma-and-postgresql/61569b8c28ed304eb1d80953/comment/6265b3ac5dd5677e9b8df1f2)

Interesting method. I don't understand only how do you switch dev and test database urls, I don't see two `.env` files in your example repo? You don't run tests locally, only in Github Actions?

[Manthan Mallikarjun](https://hashnode.com/@nahtnam)

[Apr 24, 2022](https://hashnode.com/posts/a-better-way-to-run-integration-tests-with-prisma-and-postgresql/61569b8c28ed304eb1d80953/comment/6265b3ac5dd5677e9b8df1f2#reply-6265c8e25dd5677e9b8df325)

Hello, the test suite works locally as well! It uses the same connection as your dev database, however, it uses a different (random) [postgres schema](https://www.postgresql.org/docs/current/ddl-schemas.html) each time. When you're using prisma in a web server you'll likely be using the "default" schema so your data will not be affected since we generate a random UUID for the schema name. See this code: [github.com/ludicroushq/prisma-integration-test-ex…](https://github.com/ludicroushq/prisma-integration-test-example/blob/master/prisma/)**mocks**/index.ts#L16-L19
