New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cwqt/refract

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cwqt/refract - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

package.json
{
"name": "@cwqt/refract",
"version": "1.3.0",
"version": "1.3.1",
"description": "Generate Prisma from TypeScript",

@@ -5,0 +5,0 @@ "author": "cwqt",

@@ -97,4 +97,29 @@ # refract

All scalars are variadic functions that take values of the modifiers as follows:
Scalars are the types of data that the column contains, `Int`, `String`
etc. You can define & re-use Scalars wherever in your models
```typescript
const PrimaryKey = Int(Id, Default('autoincrement()'));
// id Int @id @default("autoincrement()")
m.Field('id', PrimaryKey);
```
## Modifiers
Modifiers are functions/objects that append attributes to a column e.g.
```typescript
// String? @default("Hello World")
String(Default('Hello World'), Nullable);
// Int @id @unique @default(autoincrement())
Int(Id, Unique, Default('autoincrement()'));
// DateTime @default(now()) @updatedAt
DateTime(Default('now()'), UpdatedAt);
```
Certain modifiers are constrained to certain scalars, the mapping is:
- `String`: Unique, Id, Default(string | 'auto()'), Limit(number)

@@ -112,15 +137,7 @@ - `Int`: Unique, Id, Default('cuid' | 'autoincrement()' | 'uuid()' | number)

```typescript
// Int @id @default(autoincrement())
Int(Id, Default('autoincrement()'));
The `Raw()` modifier can be used as an escape hatch:
// DateTime @default(now()) @updatedAt
DateTime(Default('now()'), UpdatedAt);
```
The `Raw()` modifier to use any unsupported Prisma decorators, e.g.
```typescript
// String @db.ObjectId @map("_id") @default(auto())
String(Raw('@db.ObjectId'), Map('_id'), Default('auto()'));
// String @db.ObjectId
String(Raw('@db.ObjectId'));
```

@@ -127,0 +144,0 @@

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