- Run database
docker-compose up -d
-
Setup .env file
Copy.env.template
and rename the file to.env
. -
Prisma setup
pnpm dlx prisma init
pnpm dlx prisma migrate dev
pnpm dlx prisma generate
Next steps:
- Set the
DATABASE_URL
in the.env
file to point to your existing database. If your database has no tables yet, read https://pris.ly/d/getting-started - Set the
provider
of thedatasource
block inschema.prisma
to match your database:postgresql
,mysql
,sqlite
,sqlserver
,mongodb
orcockroachdb
. - Run
prisma db pull
to turn your database schema into a Prisma schema. - Run
prisma generate
to generate the Prisma Client. You can then start querying your database.
More information in our documentation:
https://pris.ly/d/getting-started
Start using Prisma Client in Node.js (See: https://pris.ly/d/client)
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)
import { PrismaClient } from '@prisma/client/edge'
const prisma = new PrismaClient()
See other ways of importing Prisma Client: http://pris.ly/d/importing-client
- Execute seed.
[GET] http://localhost:8080/api/seed