Skip to content

snake575/read-replicas-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Read Replicas example

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.

Getting started

1. Download example and install dependencies

Clone this repository:

git clone [email protected]:prisma/read-replicas-demo.git --depth=1

Install npm dependencies:

cd read-replicas-demo
npm install

2. Create the database

Run 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 init

3. Run the script

Execute the script with this command:

npm run dev

Next steps

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%