Socket
Socket
Sign inDemoInstall

prisma-datamodel

Package Overview
Dependencies
Maintainers
1
Versions
345
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-datamodel - npm Package Compare versions

Comparing version 1.32.0-alpha.5 to 1.32.0-alpha.6

2

package.json
{
"name": "prisma-datamodel",
"version": "1.32.0-alpha.5",
"version": "1.32.0-alpha.6",
"description": "Transform prisma datamodel SDL into graphql-js SDL",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -7,7 +7,7 @@ # prisma-datamodel

* Data structures to represent datamodels in memory: `ISDL`, `IGQLType`, `IGQLField`. These data structures are documented inline. The data structures might be self referencing, and all operations in this library guarantee to keep the references valid.
* Constants for known primitive types: `TypeIdentifier`, `TypeIdentifiers`
* Classes to parse data models from strings into the internal format: `Parser`, with the factory class`DefaultParser`
* Classes to render data models to strings, from the internal format: `Renderer`, with the factory class `Default Renderer`
* Auxiliary functions: `cloneSchema` to safely clone an `ISDL`structure, `toposort`to sort a datamodel in topological order.
- Data structures to represent datamodels in memory: `ISDL`, `IGQLType`, `IGQLField`. These data structures are documented inline. The data structures might be self referencing, and all operations in this library guarantee to keep the references valid.
- Constants for known primitive types: `TypeIdentifier`, `TypeIdentifiers`
- Classes to parse data models from strings into the internal format: `Parser`, with the factory class`DefaultParser`
- Classes to render data models to strings, from the internal format: `Renderer`, with the factory class `Default Renderer`
- Auxiliary functions: `cloneSchema` to safely clone an `ISDL`structure, `toposort`to sort a datamodel in topological order.

@@ -20,3 +20,3 @@ ### Different Database Types

The parser is capable of parsing both datamodel formats, and even models with mixed directives from both standards. For rendering, a flag can be passed which indicates the datamodel format to follow.
The parser is capable of parsing both datamodel formats, and even models with mixed directives from both standards. For rendering, a flag can be passed which indicates the datamodel format to follow.

@@ -38,11 +38,17 @@ ### Modifying a Model

// Do something with the model
for(const type of model.types) {
console.log(`${type.name} has ${type.fields.length} fields and ${type.indices.length} indexes`)
for (const type of model.types) {
console.log(
`${type.name} has ${type.fields.length} fields and ${
type.indices.length
} indexes`,
)
}
const enableDatamodel1_1 = true
const renderer = DefaultRenderer.create(DatabaseType.postgres, enableDatamodel1_1)
const renderer = DefaultRenderer.create(
DatabaseType.postgres,
enableDatamodel1_1,
)
const renderedAsString = renderer.render(model)
```
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