adminjs-prisma icon indicating copy to clipboard operation
adminjs-prisma copied to clipboard

Prisma v7 compatibility

Open GibsDev opened this issue 1 month ago • 1 comments

It looks like this is not yet compatible with Prisma v7. There are some nice features in v7 that would be great to take advantage of.

https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7

GibsDev avatar Dec 08 '25 19:12 GibsDev

What happens if you upgrade to Prisma 7? We're on 6.7, but switched to the new queryCompiler and started getting the following error:

Error: Resource: "<model>" does not have an id property

Looking at Property.js#isId and Resource.js#prepareProperties, it looks like isId is no longer set in Prisma's new modeling.

We got around this by locally patching adminjs/prisma to turn:

      const property = new Property(
        field,
        Object.keys(memo).length,
        this.enums,
      );

into

      const property = new Property(
        { ...field, isId: field.name === 'id'},
        Object.keys(memo).length,
        this.enums,
      );

and this seems to have fixed it for now

alihussain5 avatar Dec 29 '25 18:12 alihussain5