brackets-prisma-db
v1.0.2
Published
A sql database with prisma for brackets-manager.js
Downloads
65
Maintainers
Readme
brackets-prisma-db
This implementation of the CrudInterface
uses prisma to store the data in an SQL Database.
Warning This implementation has not been full tested yet. Use with caution.
Limitations
Currently there are some features of the manager that can't be used.
| Feature | Status | | ------------------- | --------------- | | Custom Participants | Implemented | | Custom Matches | Not Implemented |
Usage
To use this implementation make sure you have prisma included in your project. A Guide on how to include prisma in your project can be found on the official documentation page.
Once prisma is included in your project copy the schema.prisma
into your project.
If you have an existing schema.prisma
in your project copy and paste the schema definitions into your existing one.
Warning Do not rename any of the models or enums provided! This will break the implementation.
Next generate the prisma client using npx prisma generate
.
Lastly push the definition to your database using npx prisma db push
.
import { SqlDatabase } from 'brackets-prisma-db';
import { prisma } from './client';
import { BracketsManager } from 'brackets-manager';
const storage = new SqlDatabase(prisma);
const manager = new BracketsManager(storage);