0.1.5 • Published 1 year ago
@jessenzr/prisma-mass-production v0.1.5
#+title: Readme
Create factories and use them to populate database. This package is based on Laravel's Eloquent factories. It can help you generate model instances for your tests or seeding database. It works well with libraries like faker.
It's an experimental package and still in very alpha stage.
- Examples #+begin_src typescript import { Prisma, User } from '@prisma/client' import Factory from '@jessenzr/prisma-mass-production'
// define the factory const UserFactory = Factory.make<Prisma.UserCreateInput, User>('User', () => ({ name: 'Jonh Smith', }) ) // use the factory await UserFactory.create() await UserFactory.create({ name: 'overriding the default param' }) #+end_src