This example shows how to use database replication using the @prisma/extension-read-replicas extension in Prisma Client in a simple TypeScript script to read and write data in a PostgreSQL database.
Clone this repository:
git clone [email protected]:prisma/read-replicas-demo.git --depth=1Install npm dependencies:
cd read-replicas-demo
npm installRun the following command to create your PostgreSQL database file. This also creates the User and Post tables that are defined in prisma/schema.prisma:
npx prisma migrate dev --name initExecute the script with this command:
npm run dev- Check out the Prisma docs
- Share your feedback in the
#product-wishlistchannel on the Prisma Slack - Create issues and ask questions on GitHub
- Watch our biweekly "What's new in Prisma" livestreams on Youtube