How to use getDMMF
I use the following code to load the dmmf from a absolute path:
I get the following error:
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.nodeGraphQLError: 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