Skip to content
Branch: master
Find file History
Latest commit 8ccfa80 May 29, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
prisma adjust datamodel to v1.1 Apr 15, 2019
src prettier Feb 5, 2019
README.md add mysql and postgres examples for node Jan 17, 2019
docker-compose.yml update to v1.34 May 28, 2019
package.json Update dependency prisma-client-lib to v1.34.0 May 29, 2019

README.md

PostgreSQL with Docker Example

This example shows how to set up Prisma using Docker and PostgreSQL locally on your machine. It then uses the Prisma client in a simple Node script to read and write data in the database.

This example uses a new and empty database. Learn how to connect Prisma to your existing database here.

How to use

1. Download example & install dependencies

Clone the repository:

git clone git@github.com:prisma/prisma-examples.git

Install Node dependencies:

cd prisma-examples/node/docker-postgres
npm install

2. Launch Prisma with Docker

This example is based on Docker. If you don't have Docker installed, you can get it from here. Use the Docker Compose CLI to launch the Docker containers specified in docker-compose.yml:

docker-compose up -d

3. Install the Prisma CLI

To run the example, you need the Prisma CLI. Please install it via NPM or using another method:

npm install -g prisma

4. Set up database & deploy Prisma datamodel

To deploy the datamodel for this example, run the following command:

prisma deploy

5. Run the script

Execute the script with this command:

npm run start

Next steps

You can’t perform that action at this time.