Skip to content

require syntax #19

Description

@ilanbro

Hi,

I've managed to get the extension working successfully in JS using the sample code shared in .md.
I have an issue running the same example using the 'require' syntax.

const { PrismaClient } = require('@prisma/client'); const prismaRandom = require('prisma-extension-random'); // const prisma = new PrismaClient(); const prisma = new PrismaClient().$extends(prismaRandom);

The errors that I'm getting are:
TypeError: prisma.newQuote.findRandom is not a function
TypeError: prisma.newQuote.findManyRandom is not a function

I've tried multiple other forms to workaround it but assume this is an issue upstream / in the module itself and it exports the prismaRandom interface?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions