Skip to content

Trying to create website to keep track of my coins. Need help with authorization and authentication, code reviews, database management, Prisma Orm.

Notifications You must be signed in to change notification settings

ericbrian/coinorganizer

Repository files navigation

Examples followed:

To Regenerate Prisma Schema, use:

  1. Remove old database models from schema file: prisma/schema.prisma
  2. Run: ./node_modules/.bin/prisma db pull
  3. Run: ./node_modules/.bin/prisma generate

You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

When you want relations in your Prisma types, you have to build it yourself like so:

import { Prisma } from '@prisma/client';

// GET type
type CoinType = Prisma.coinGetPayload<{
  include: {
    country: true;
    ruler: true;
    period: true;
    coin_mint: { include: { mint: true } };
    coin_engraver: { include: { engraver: true } };
    image: true;
  };
}>;

// POST type
coinst coin: Prisma.coinCreateInput = ...

About

Trying to create website to keep track of my coins. Need help with authorization and authentication, code reviews, database management, Prisma Orm.

Topics

Resources

Security policy

Stars

Watchers

Forks