Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@prisma/internals
Advanced tools
This package is intended for Prisma's internal use
@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.
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();
Knex.js is a SQL query builder for Node.js that supports multiple database types. It provides a more general-purpose query building and schema management functionality compared to the more Prisma-specific utilities in @prisma/internals.
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. It offers a higher-level abstraction for database operations, whereas @prisma/internals provides lower-level utilities specific to Prisma.
TypeORM is an ORM for TypeScript and JavaScript (ES7, ES6, ES5). It supports multiple database types and provides a comprehensive set of features for database management. TypeORM is more focused on ORM capabilities, while @prisma/internals offers internal utilities for Prisma.
FAQs
This package is intended for Prisma's internal use
The npm package @prisma/internals receives a total of 186,779 weekly downloads. As such, @prisma/internals popularity was classified as popular.
We found that @prisma/internals demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.