hey all, i'm a founder of a developer focused kno...
# prisma-client
k
hey all, i'm a founder of a developer focused knowledge base and I'm currently researching whether prisma can be embedded into our application. so far, its checking all the boxes - just one holdout i'm hoping folks here can help me with. can a custom prisma client be exported as a npm package so that it can be used as a public facing sdk? our use case: we offer a plain text based knowledge base for developers and the metadata will be stored in sqlite. we have multiple clients (eg. CLI, VSCode, vim) that need to access the metadata - ideally, we can define the prisma model in one place and then export it to all the packages that need it. Basically do something like the following and consume this in a separate package
Copy code
ts
import { PrismaClient } from '@prisma/client'
export { PrismaClient as DendronClient }
🔥 1
j
Not sure if this is what you are after but I can confirm you can export these to be used in other packages. For example we have a monorepo where we publish our prisma schema as a package
Copy code
import type { SomeEntity } from '@acmecorp/prisma'

import { PrismaClient } from '@acmecorp/prisma'
which our applications can import and use
k
yeah, is exactly what i'm looking for. wanted to see if this was kosure 😅
n
I have seen most users creating a private npm package which exports PrismaClient and types generated by prisma, and importing them in a different project
👍 1