npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cocrepo/prisma

v1.0.11

Published

Prisma schema and client for the core project

Readme

@cocrepo/db

Prisma 스키마 및 데이터베이스 클라이언트를 제공하는 패키지입니다.

중요: 이 패키지는 리팩토링되어 Prisma 전용 패키지가 되었습니다. DTO, Entity, Enum, Decorator는 별도 패키지로 분리되었습니다.

마이그레이션 가이드: docs/SCHEMA-REFACTORING.md

분리된 패키지

| 기능 | 새 패키지 | | --------------------- | -------------------- | | Data Transfer Objects | @cocrepo/dto | | 엔티티 정의 | @cocrepo/entity | | 열거형 | @cocrepo/enum | | 데코레이터 | @cocrepo/decorator | | 스키마 상수 | @cocrepo/constant |

현재 패키지 역할

  • Prisma 스키마 관리
  • 타입 안전 데이터베이스 클라이언트
  • 마이그레이션 관리
  • 시드 데이터

주요 기능

  • Prisma 멀티 파일 스키마 지원
  • 타입 안전 데이터베이스 클라이언트
  • 공통 데이터베이스 유틸리티
  • 백엔드 서비스 간 공유 타입

Installation

This package is part of the workspace and is automatically available to other packages.

Usage

Basic Usage

import { PrismaClient, prisma } from "@shared/prisma";

// Use the default instance
const users = await prisma.user.findMany();

// Or create your own instance
const customClient = new PrismaClient();

Type Exports

import type { User, CreateInput, UpdateInput } from "@shared/prisma";

// Use generated Prisma types
type UserData = User;

// Use utility types
type CreateUserInput = CreateInput<User>;
type UpdateUserInput = UpdateInput<User>;

Scripts

Development

  • pnpm generate - Generate Prisma client from multi-file schema
  • pnpm build - Build the package
  • pnpm start:dev - Build in watch mode

Database Operations

  • pnpm db:push - Push schema to database
  • pnpm db:pull - Pull schema from database
  • pnpm db:studio - Open Prisma Studio
  • pnpm db:migrate - Create and apply migrations
  • pnpm db:migrate:deploy - Deploy migrations to production
  • pnpm db:reset - Reset database and re-run migrations
  • pnpm db:seed - Seed the database

Multi-File Schema Architecture (Prisma Official)

This project uses Prisma's official multi-file schema support (GA since Prisma 6.7.0) to organize models into separate domain files:

prisma/
├── schema/              # Multi-file schema directory
│   ├── _base.prisma     # Generator and datasource configuration
│   ├── core.prisma      # Core business models (Tenant, Category, etc.)
│   ├── user.prisma      # User and authentication models
│   ├── role.prisma      # Role-based access control models
│   ├── space.prisma     # Space management models
│   ├── file.prisma      # File management models
│   └── task.prisma      # Task and timeline models
├── migrations/          # Database migrations
└── seed.ts             # Database seeding script

How It Works

Prisma automatically combines all .prisma files in the prisma/schema/ directory:

  1. Edit any schema file: Make changes to files in prisma/schema/
  2. Generate client: Run pnpm generate
  3. Create migrations: Run pnpm db:migrate

No merge script needed - Prisma handles it natively!

Configuration

The multi-file schema is configured in prisma.config.ts:

export default defineConfig({
  schema: "./prisma/schema", // Points to directory, not file
  // ...
});

Schema Statistics

Current schema contains:

  • 30 models across 6 domain files
  • 14 enums for type safety
  • Automatic cross-file model referencing (no imports needed)

Environment Variables

Required environment variables:

  • DATABASE_URL - PostgreSQL connection string
  • DIRECT_URL - Direct PostgreSQL connection string (optional)