notiz-dev / prisma-dbml-generator

Prisma DBML Generator
MIT License
684 stars 37 forks source link

Upcoming rename of `@prisma/sdk` to `@prisma/internals` with Prisma 4 #34

Closed janpio closed 2 years ago

janpio commented 2 years ago

Hey,

Jan from Prisma Engineering here.

Quick heads up that we will soon rename our @prisma/sdk package to @prisma/internals with Prisma 4, which we plan to release on June 28th (soon!).

The @prisma/sdk package was meant as an Prisma internal package only, but somehow it leaked out over time and is now used across all kinds of tools - including yours of course 😄

With the rename of the Npm package we want to make it clearer that we can not give any API guarantees for @prisma/internals, might need to introduce breaking changes to the API from time to time and will not follow semantic versioning (breaking changes only in major upgrade) with it. We think that it is better communicated with internals than with sdk. With Prisma 4, besides the package name nothing should change though.

Additionally it would be super helpful if you could help us gain an understanding where, how and why you are using @prisma/sdk (soon @prisma/internals, remember 😀) to achieve, what exactly. We want to cleanup that package and your feedback will be valuable to us to define a better API.

Looking forward to your feedback.

Best Jan & your friends at Prisma

PS: Are you using Prisma.dmmf from import { Prisma } from '@prisma/client' in your code somewhere by chance? That will also change soon and not include the Prisma.dmmf.schema sub property. Instead you can use getDmmf from @prisma/internals moving forward.

marcjulian commented 2 years ago

Hey Jan, thanks for reaching out to me about the upcoming changes.

I'm using @prisma/sdk once in the generator and twice for test utils.

Generator

Parsing generator config output, as suggested in https://github.com/notiz-dev/prisma-dbml-generator/pull/9

https://github.com/notiz-dev/prisma-dbml-generator/blob/b5969a332eb0bacdd3f405e8d14385ccf77f5d78/src/cli/dbml-generator.ts#L2

https://github.com/notiz-dev/prisma-dbml-generator/blob/b5969a332eb0bacdd3f405e8d14385ccf77f5d78/src/cli/dbml-generator.ts#L14

Test Utils

For tests the following utils use @prisma/sdk:

Generates DMMF based on the provided Prisma schema

https://github.com/notiz-dev/prisma-dbml-generator/blob/b5969a332eb0bacdd3f405e8d14385ccf77f5d78/__tests__/utils/generateDMMF.ts#L1-L6

Creates the generator config for the provided generator dbml block

https://github.com/notiz-dev/prisma-dbml-generator/blob/b5969a332eb0bacdd3f405e8d14385ccf77f5d78/__tests__/utils/generateConfig.ts#L1-L5

Any suggestions if those functionalities are already provided by a different package, which should be used for a community generator?

Jolg42 commented 2 years ago

@marcjulian Thank you! These functionalities will stay, renaming @prisma/sdk to @prisma/internals should be what you need for now.

We are still collecting feedback from other consumers, after that we want to think about a better API for community tools, so stay tuned 📻

Jolg42 commented 2 years ago

Note: You can try prisma packages on the dev tag on npm, like @prisma/internals@3.16.0-dev.84

Jolg42 commented 2 years ago

@marcjulian Prisma 4.0.0 was published on Tuesday :canoe:

The internal package @prisma/sdk

If you know people affected by this, feel free to point them to this GitHub discussion. It will help us understand where, how, and why people are using it, so we can define a better API.

Note: I posted your earlier comment of your current usage in that discussion to centralize the usage feedback.