This example shows how to use TypeORM with Prisma Postgres.
Clone this repository and download this template:
npx try-prisma@latest --template databases/typeorm-prisma-postgresThen navigate into the project directory and install dependencies:
cd typeorm-prisma-postgres
npm installRun the following command to create a Prisma Postgres database:
npx create-db@latestCopy 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.
npm run devThe 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.