P
Prisma5mo ago
schettn

How to use getDMMF

I use the following code to load the dmmf from a absolute path:
const PYLON_ABSOLUTE_PATH = '/Users/schettn/Documents/pylon/pylon-template'

import {getDMMF} from '@prisma/internals'
// import {getDMMF} from '@prisma/sdk'

export default defineService({
Query: {
async prismaDMMF() {
console.log(process.cwd())

const dmmf = await getDMMF({
datamodelPath: path.join(PYLON_ABSOLUTE_PATH, 'prisma/schema.prisma')
})

return dmmf
}
}
})
const PYLON_ABSOLUTE_PATH = '/Users/schettn/Documents/pylon/pylon-template'

import {getDMMF} from '@prisma/internals'
// import {getDMMF} from '@prisma/sdk'

export default defineService({
Query: {
async prismaDMMF() {
console.log(process.cwd())

const dmmf = await getDMMF({
datamodelPath: path.join(PYLON_ABSOLUTE_PATH, 'prisma/schema.prisma')
})

return dmmf
}
}
})
I get the following error:
GraphQLError: Get DMMF: Unable to resolve path to query-engine binary
Details: Could not find libquery-engine binary. Searched in:
- /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon/libquery_engine-darwin-arm64.dylib.node
- /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon/libquery_engine-darwin-arm64.dylib.node
- /Users/schettn/Documents/pylon/packages/pylon-server/libquery_engine-darwin-arm64.dylib.node
- /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon/runtime/libquery_engine-darwin-arm64.dylib.node
GraphQLError: Get DMMF: Unable to resolve path to query-engine binary
Details: Could not find libquery-engine binary. Searched in:
- /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon/libquery_engine-darwin-arm64.dylib.node
- /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon/libquery_engine-darwin-arm64.dylib.node
- /Users/schettn/Documents/pylon/packages/pylon-server/libquery_engine-darwin-arm64.dylib.node
- /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon/runtime/libquery_engine-darwin-arm64.dylib.node
1 Reply
schettn
schettnOP5mo ago
The CWD: /Users/schettn/Documents/pylon/packages/pylon-server/studio-pylon The query-engine exists under the following path: packages/pylon-server/studio-pylon/node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node Setting the cwd also does not change anything.
const dmmf = await getDMMF({
cwd: process.cwd(),
datamodelPath: path.join(PYLON_ABSOLUTE_PATH, 'prisma/schema.prisma')
})
const dmmf = await getDMMF({
cwd: process.cwd(),
datamodelPath: path.join(PYLON_ABSOLUTE_PATH, 'prisma/schema.prisma')
})
Update: @prisma/internals seems to work. @prisma/sdk does not
Want results from more Discord servers?
Add your server