Skip to content

thechrisclerc/notebook

Repository files navigation

Get Started

npm i
npm install @prisma/client
npx prisma generate
npx prisma migrate/dev

Create a Database

Prisma defaults to Postgres. I suggest going to Railway.app and spinning up a db if you don't have a local instance.

Add postgres db URL in .env

DATABASE_URL="postgresql://janedoe:mypassword@localhost:5432/mydb?schema=sample"

Seed database

npx prisma db seed

⚠️Issues with seeding

If you get this error:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"

The solution that worked for me was to remove this:

"type": "module"

from the package.json file when seeding, but add it back once you are done.

You could also try:

node --loader ts-node/esm "prisma/seed.ts"

instead of:

npx prisma db seed

although, this doesn't work for me and I haven't spent the time to figure out why.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published