Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

TypeORM with Prisma Postgres

This example shows how to use TypeORM with Prisma Postgres.

Getting started

1. Download the example and install dependencies

Clone this repository and download this template:

npx try-prisma@latest --template databases/typeorm-prisma-postgres

Then navigate into the project directory and install dependencies:

cd typeorm-prisma-postgres
npm install

2. Create a Prisma Postgres database

Run the following command to create a Prisma Postgres database:

npx create-db@latest

Copy the DATABASE_URL from the output and add it to a .env file:

DATABASE_URL="postgresql://..."

Tip: Claim your database at the provided URL to keep it permanently.

3. Run the example

npm run dev

The script will:

  • create a user with a post
  • query all published posts and include each author
  • update one post title

TypeORM is configured with synchronize: true in src/index.ts, so tables are created automatically from the entities when the script runs.

Next steps