Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support accessing the DMMF at runtime #909

Open
ormenesse opened this issue Feb 14, 2024 · 1 comment
Open

Support accessing the DMMF at runtime #909

ormenesse opened this issue Feb 14, 2024 · 1 comment

Comments

@ormenesse
Copy link

Problem

Using typescript, I some times have to map all the schema with the following code:

async function generatePrismaVariablesDescriptions(): Promise<any> {
  const a = {};
  //return Prisma.dmmf.datamodel.models;
  Prisma.dmmf.datamodel.models.map((model) => {
    //a[model.name] = {};
    model.fields.map((b) => {
      a[b.name] = b.isList ? b.type.toString() + '[]' : b.type.toString();
    });
  });
  return a;
}

It is unfortunate that right now this method is not implemented.

Suggested solution

Add similar method to python library.

@RobertCraigie RobertCraigie changed the title Add Prisma.dmmf.datamodel.models. in python Support accessing the DMMF at runtime Feb 14, 2024
@RobertCraigie
Copy link
Owner

Can you share your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants