0.1.1 • Published 1 year ago

feathers-adapter-prisma v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

feathers-adapter-prisma

Feathers v5 SQL service adapter using Prisma

This project is in alpha quality and is a work in progress.

Installation

npm install feathers-adapter-prisma --save

Usage

// import PrismaClient and any models you'd like to expose as a feathers service
import { PrismaClient, User } from '@prisma/client';
import { feathers } from '@feathersjs/feathers';
import { PrismaService } from 'feathers-adapter-prisma';

const prismaClient = new PrismaClient();

const users = new PrismaService({
  client: prismaClient,
  name: 'user', // must be a valid model name
});

type ServiceTypes = {
  users: PrismaService<User>
}

const app = feathers<ServiceTypes>()
  .use('users', users);

const usersService = app.service('users');