Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prisma/internals

Package Overview
Dependencies
Maintainers
3
Versions
4576
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma/internals

This package is intended for Prisma's internal use

  • 5.23.0-dev.10
  • dev
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
120K
decreased by-55.31%
Maintainers
3
Weekly downloads
 
Created

What is @prisma/internals?

@prisma/internals is a package that provides internal utilities and functions for working with Prisma, a modern database toolkit for TypeScript and Node.js. This package is typically used for advanced use cases and internal operations within the Prisma ecosystem.

What are @prisma/internals's main functionalities?

Engine Configuration

This feature allows you to retrieve the version of the Prisma engine being used. This can be useful for debugging and ensuring compatibility.

const { getEngineVersion } = require('@prisma/internals');

async function printEngineVersion() {
  const version = await getEngineVersion();
  console.log(`Prisma Engine Version: ${version}`);
}

printEngineVersion();

Schema Parsing

This feature allows you to parse a Prisma schema string into an internal representation. This can be useful for programmatically analyzing or modifying Prisma schemas.

const { parseSchema } = require('@prisma/internals');

const schema = `
model User {
  id    Int     @id @default(autoincrement())
  name  String
}`;

async function parsePrismaSchema() {
  const parsedSchema = await parseSchema(schema);
  console.log(parsedSchema);
}

parsePrismaSchema();

DMMF (Data Model Meta Format) Generation

This feature allows you to generate the Data Model Meta Format (DMMF) from a Prisma schema. DMMF is a JSON representation of the Prisma schema, which can be used for various advanced use cases.

const { getDMMF } = require('@prisma/internals');

const schema = `
model User {
  id    Int     @id @default(autoincrement())
  name  String
}`;

async function generateDMMF() {
  const dmmf = await getDMMF({ datamodel: schema });
  console.log(JSON.stringify(dmmf, null, 2));
}

generateDMMF();

Other packages similar to @prisma/internals

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc