Prisma Schema Language (PSL) user-defined language #359
+130
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Foreword & Motivation
While building a TypeScript based ecommerce platform for a client, after I changed our current SQL seed integration and went to mess around with the Prisma schema, I noticed Notepad++ was not formatting or allowing me to collapse any part of the code. Upon checking for the best language to use to exhibit similar behavior, I noticed I could define a language and remembered not too long ago I followed NPP on Github. I figured why not see what I could do here.
I went ahead and I made one for NPP, I've been using your wonderful software for years and I figured I'd contribute at least something, thanks for all your hard work fellow devs.
I made an issue at first before I realized I could make a PR, #358 which I closed. Happy to make any changes to fix any nits.
Prisma Schema Language UDL for Notepad++
Special Features
Comprehensive Keyword Coverage
model,enum,datasource,generator,type,viewString,Int,Float,Boolean,DateTime,Json,Bytes,Decimal,BigInt,Unsupportedpostgresql,mysql,sqlite,sqlserver,mongodb,cockroachdbFull Attribute Support with Prefix Handling
@prefix):@id,@default,@unique,@relation,@map,@updatedAt,@ignore,@db@@prefix):@@id,@@unique,@@index,@@map,@@ignore,@@schema,@@shardKey,@@fulltext@and@@symbol recognitionAttribute Functions & Values
autoincrement,cuid,uuid,ulid,nanoid,now,auto,dbgenerated,sequenceenvtrue,false,nullCascade,Restrict,NoAction,SetNull,SetDefaultAsc,DescConfiguration Options
provider,url,shadowDatabaseUrl,directUrl,relationMode,extensionsoutput,previewFeatures,engineType,binaryTargetsfields,references,onDelete,onUpdate,nameNative Database Type Annotations
@db.*type annotations for database-specific typesObjectId,Uuid,Text,VarChar,Char,SmallInt,Double,Date,Time,Timestamp,JsonB,ByteAComment Support
/////(treated same as line comments for highlighting)/* */Code Folding
{ }for model, enum, datasource, and generator blocksColor Scheme (Light Theme)
model,enum, etc.)String,Int, etc.)@id,@default, etc.)@@id,@@unique, etc.)autoincrement,uuid, etc.)provider,url, etc.)postgresql,Cascade, etc.)prisma-client-js,ObjectId, etc.)References
Official Prisma Documentation
Schema Components
Field & Block Attributes
Database-Specific Features
Prisma Schema Reference (Complete)
Compatibility
.prisma