@prisma/language-server
Version:
Prisma Language Server
637 lines (636 loc) • 21.4 kB
JSON
{
"primitiveTypes": [
{
"label": "String",
"documentation": "Variable length text"
},
{
"label": "Boolean",
"documentation": "True or false value"
},
{
"label": "Int",
"documentation": "Integer value"
},
{
"label": "Float",
"documentation": "Floating point number"
},
{
"label": "DateTime",
"documentation": "Timestamp"
},
{
"label": "Json",
"documentation": "A JSON object"
},
{
"label": "Bytes",
"documentation": ""
},
{
"label": "Decimal",
"documentation": "Decimal value"
},
{
"label": "BigInt",
"documentation": "Integer values that may be greater than 2^53"
},
{
"label": "Unsupported",
"insertText": "Unsupported(\"$0\")",
"documentation": "An arbitrary database column type, for which Prisma has no syntax. Fields of type `Unsupported` work with Prisma Migrate and introspection, but are not exposed in Prisma Client.",
"fullSignature": "Unsupported(_ name: String)",
"params": [
{
"label": "name",
"documentation": "Name of the column type as expected by the underlying database, e.g. Unsupported(\"GEOGRAPHY(POINT,4326)\"). This string is not validated by Prisma Migrate and will be used by Prisma Migrate to generate the DDL statements to evolve the database schema. Prisma Introspect will overwrite this when re-introspecting if the type does not match."
}
]
}
],
"blockTypes": [
{
"label": "datasource",
"documentation": "The datasource block tells the schema where the models are backed."
},
{
"label": "generator",
"documentation": "Generator blocks configure which clients are generated and how they're generated. Language preferences and binary configuration will go in here."
},
{
"label": "model",
"documentation": "Models represent the entities of your application domain. They are defined using model blocks in the data model."
},
{
"label": "enum",
"documentation": "Enums are defined via the enum block. You can define enums in your data model if they're supported by the datasource you use (e.g SQLite: not supported)."
},
{
"label": "view",
"documentation": "Views are defined via the view block."
},
{
"label": "type",
"documentation": "Composite types (known as [embedded documents](https://www.mongodb.com/docs/manual/core/data-model-design/#std-label-data-modeling-embedding) in MongoDB) provide support for embedding records inside other records. [Learn more](https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#defining-composite-types)"
}
],
"generatorFields": [
{
"label": "provider",
"insertText": "provider = \"$0\"",
"documentation": "Describes which generator to use. This can point to a file that implements a generator or specify a built-in generator directly. [Learn more](https://pris.ly/d/generator-fields).",
"fullSignature": "provider = \"String\""
}
],
"generatorPrismaClientFields": [
{
"label": "previewFeatures",
"insertText": "previewFeatures = [\"$0\"]",
"documentation": "Enables Preview Feature flags. [Learn more](https://pris.ly/d/preview-features).",
"fullSignature": "previewFeatures = PreviewFeature[]"
},
{
"label": "output",
"insertText": "output = \"$0\"",
"documentation": "Directory where Prisma Client is generated, e.g. ../src/generated/prisma.",
"fullSignature": "output = \"String\""
},
{
"label": "runtime",
"insertText": "runtime = \"$0\"",
"documentation": "Target runtime environment. Supported values: nodejs, deno, bun, workerd (alias cloudflare), vercel-edge (alias edge-light), react-native.",
"fullSignature": "runtime = \"nodejs\" | \"deno\" | \"bun\" | \"workerd\" | \"cloudflare\" | \"vercel-edge\" | \"edge-light\" | \"react-native\""
},
{
"label": "moduleFormat",
"insertText": "moduleFormat = \"$0\"",
"documentation": "Module format (esm or cjs). Determines whether import.meta.url or __dirname is used.",
"fullSignature": "moduleFormat = \"esm\" | \"cjs\""
},
{
"label": "generatedFileExtension",
"insertText": "generatedFileExtension = \"$0\"",
"documentation": "File extension for generated TypeScript files (ts, mts, cts).",
"fullSignature": "generatedFileExtension = \"ts\" | \"mts\" | \"cts\""
},
{
"label": "importFileExtension",
"insertText": "importFileExtension = \"$0\"",
"documentation": "File extension used in import statements. Can be ts, mts, cts, js, mjs, cjs, or empty (for bare imports).",
"fullSignature": "importFileExtension = \"ts\" | \"mts\" | \"cts\" | \"js\" | \"mjs\" | \"cjs\" | \"\""
},
{
"label": "compilerBuild",
"insertText": "compilerBuild = \"$0\"",
"documentation": "The build of the query compiler to use. Can be 'fast' or 'small'.",
"fullSignature": "compilerBuild = \"fast\" | \"small\""
}
],
"generatorPrismaClientJSFields": [
{
"label": "previewFeatures",
"insertText": "previewFeatures = [\"$0\"]",
"documentation": "Enables Preview Feature flags. [Learn more](https://pris.ly/d/preview-features).",
"fullSignature": "previewFeatures = PreviewFeature[]"
},
{
"label": "output",
"insertText": "output = \"$0\"",
"documentation": "Determines the location for the generated client. Default: `node_modules/.prisma/client`. [Learn more](https://pris.ly/d/generator-fields).",
"fullSignature": "output = \"String\""
},
{
"label": "compilerBuild",
"insertText": "compilerBuild = \"$0\"",
"documentation": "The build of the query compiler to use. Can be 'fast' or 'small'.",
"fullSignature": "compilerBuild = \"fast\" | \"small\""
}
],
"blockAttributes": [
{
"label": "@@map",
"insertText": "@@map(\"$0\")",
"documentation": "Maps a model name from the Prisma schema to a different table name.",
"fullSignature": "@@map(_ name: String)",
"params": [
{
"label": "name",
"insertText": "name: \"$0\"",
"documentation": "The name of the target database table."
}
]
},
{
"label": "@@id",
"insertText": "@@id([$0])",
"documentation": "Defines a multi-field ID on the model.",
"fullSignature": "@@id(_ fields: FieldReference[], name: String?, map: String?)",
"params": [
{
"label": "fields",
"insertText": "fields: [$0]",
"documentation": "A list of references."
},
{
"label": "name",
"insertText": "name: \"$0\"",
"documentation": "Defines the name in your Prisma Client API."
},
{
"label": "map",
"insertText": "map: \"$0\"",
"documentation": "Defines a custom name for the primary key in the database."
}
]
},
{
"label": "@@unique",
"insertText": "@@unique([$0])",
"documentation": "Defines a compound unique constraint for the specified fields.",
"fullSignature": "@@unique(_ fields: FieldReference[], name: String?, map: String?)",
"params": [
{
"label": "fields",
"insertText": "fields: [$0]",
"documentation": "A list of references."
},
{
"label": "name",
"insertText": "name: \"$0\"",
"documentation": "Defines the name in your Prisma Client API."
},
{
"label": "map",
"insertText": "map: \"$0\"",
"documentation": "Defines a custom constraint name in the database."
}
]
},
{
"label": "@@index",
"insertText": "@@index([$0])",
"documentation": "Defines an index on the model.",
"fullSignature": "@@index(_ fields: FieldReference[], map: String?)",
"params": [
{
"label": "fields",
"insertText": "fields: [$0]",
"documentation": "A list of references."
},
{
"label": "map",
"insertText": "map: \"$0\"",
"documentation": "Defines a custom index name in the database."
}
]
},
{
"label": "@@fulltext",
"insertText": "@@fulltext([$0])",
"documentation": "Defines a full-text index on the model.",
"fullSignature": "@@fulltext(_ fields: FieldReference[], map: String?)",
"params": [
{
"label": "fields",
"insertText": "fields: [$0]",
"documentation": "A list of references."
},
{
"label": "map",
"insertText": "map: \"$0\"",
"documentation": "Defines a custom index name in the database."
}
]
},
{
"label": "@@ignore",
"documentation": "A model with an `@@ignore` attribute can be kept in sync with the database schema using Prisma Migrate and Introspection, but won't be exposed in Prisma Client.",
"fullSignature": "@@ignore",
"params": []
},
{
"label": "@@schema",
"insertText": "@@schema($0)",
"documentation": "Designate which schema this belongs to. [Learn more](https://pris.ly/d/multi-schema-configuration)",
"fullSignature": "@@schema(_: String)",
"params": []
},
{
"label": "@@shardKey",
"insertText": "@@shardKey($0)",
"documentation": "Defines a shard key based on multiple fields of the model. Only compatible with PlanetScale and Vitess.",
"fullSignature": "@@shardKey(_: FieldReference[])",
"params": []
}
],
"fieldAttributes": [
{
"label": "@id",
"fullSignature": "@id",
"documentation": "Defines a single-field ID on the model.",
"params": [
{
"label": "map",
"insertText": "map: \"$0\"",
"documentation": "Defines a custom primary key name in the database."
},
{
"label": "length",
"insertText": "length: $0",
"documentation": "Defines a maximum length for the subpart of the value to be indexed in cases where the full value would exceed MySQL's limits for index sizes. See https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html"
},
{
"label": "sort",
"insertText": "sort: $0",
"documentation": "Specify in which order the entries of the index are stored in the database. This can have an effect on whether the database is able to use an index for specific queries."
}
]
},
{
"label": "@unique",
"fullSignature": "@unique",
"documentation": "Defines a unique constraint for this field.",
"params": [
{
"label": "map",
"insertText": "map: \"$0\"",
"documentation": "Defines a custom name for the unique constraint in the database."
},
{
"label": "length",
"insertText": "length: $0",
"documentation": "Defines a maximum length for the subpart of the value to be indexed in cases where the full value would exceed MySQL's limits for index sizes. See https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html"
},
{
"label": "sort",
"insertText": "sort: $0",
"documentation": "Specify in which order the entries of the index are stored in the database. This can have an effect on whether the database is able to use an index for specific queries."
}
]
},
{
"label": "@map",
"insertText": "@map(\"$0\")",
"documentation": "Maps a field name from the Prisma schema to a different column name.",
"fullSignature": "@map(_ name: String)",
"params": [
{
"label": "name",
"documentation": "The name of the target database column."
}
]
},
{
"label": "@default",
"insertText": "@default($0)",
"documentation": "Defines a default value for this field. `@default` takes an expression as an argument.",
"fullSignature": "@default(_ expression: Expression)",
"params": [
{
"label": "expression",
"documentation": "An expression (e.g. `5`, `true`, `now()`)."
}
]
},
{
"label": "@relation",
"insertText": "@relation($0)",
"documentation": "Defines a connection between two models. [Learn more](https://pris.ly/d/relation-attribute).",
"fullSignature": "@relation(_ name: String?, map: String?, fields: FieldReference[]?, references: FieldReference[]?)",
"params": [
{
"label": "name",
"documentation": "Defines the name of the relationship. In an m-n-relation, it also determines the name of the underlying relation table."
},
{
"label": "map",
"documentation": "Defines a custom name for the foreign key in the database."
},
{
"label": "fields",
"documentation": "A list of field references of the *current* model."
},
{
"label": "references",
"documentation": "A list of field references of the model on *the other side of the relation*."
},
{
"label": "onDelete",
"documentation": "Specifies the action to perform when a referenced entry in the referenced model is being deleted."
},
{
"label": "onUpdate",
"documentation": "Specifies the action to perform when a referenced field in the referenced model is being updated to a new value."
}
]
},
{
"label": "@updatedAt",
"fullSignature": "@updatedAt",
"documentation": "Automatically stores the time when a record was last updated.",
"params": []
},
{
"label": "@ignore",
"fullSignature": "@ignore",
"documentation": "A field with an `@ignore` attribute can be kept in sync with the database schema using Prisma Migrate and Introspection, but won't be exposed in Prisma Client.",
"params": []
},
{
"label": "@shardKey",
"fullSignature": "@shardKey",
"documentation": "Defines the field as the shard key for the model. Only compatible with PlanetScale and Vitess.",
"params": []
}
],
"relationArguments": [
{
"label": "references",
"insertText": "references: [$0]",
"fullSignature": "references: []",
"documentation": "A list of field references of the model on *the other side of the relation*.",
"params": []
},
{
"label": "fields",
"insertText": "fields: [$0]",
"fullSignature": "fields: []",
"documentation": "A list of field references of the *current* model.",
"params": []
},
{
"label": "onDelete",
"insertText": "onDelete: $0",
"fullSignature": "onDelete: Cascade | Restrict | NoAction | SetNull | SetDefault",
"documentation": "Specifies the action to perform when a referenced entry in the referenced model is being deleted. [Learn more](https://pris.ly/d/referential-actions).",
"params": []
},
{
"label": "onUpdate",
"insertText": "onUpdate: $0",
"fullSignature": "onUpdate: Cascade | Restrict | NoAction | SetNull | SetDefault",
"documentation": "Specifies the action to perform when a referenced field in the referenced model is being updated to a new value. [Learn more](https://pris.ly/d/referential-actions).",
"params": []
},
{
"label": "\"\"",
"insertText": "\"$0\"",
"fullSignature": "String",
"documentation": "Defines the name of the relationship. In an m-n-relation, it also determines the name of the underlying relation table.",
"params": []
},
{
"label": "name",
"insertText": "name: \"$0\"",
"fullSignature": "name: String",
"documentation": "Defines the name of the relationship. In an m-n-relation, it also determines the name of the underlying relation table.",
"params": []
},
{
"label": "map",
"insertText": "map: \"$0\"",
"fullSignature": "map: String",
"documentation": "Defines a custom name for the foreign key in the database.",
"params": []
}
],
"generatorProviders": [
{
"label": "prisma-client",
"documentation": "Built-in generator with ESM support built-in, in preview"
},
{
"label": "prisma-client-js",
"documentation": "Built-in generator, stable but legacy."
}
],
"generatorProviderArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "Specifies a single provider."
}
],
"runtimes": [
{
"label": "nodejs",
"documentation": "Node.js runtime (Default)"
},
{
"label": "deno",
"documentation": "Deno runtime"
},
{
"label": "bun",
"documentation": "Bun runtime"
},
{
"label": "workerd",
"documentation": "Cloudflare Workerd runtime"
},
{
"label": "cloudflare",
"documentation": "Alias of \"workerd\""
},
{
"label": "vercel-edge",
"documentation": "Vercel Edge runtime"
},
{
"label": "edge-light",
"documentation": "Alias of \"vercel-edge\""
},
{
"label": "react-native",
"documentation": "React Native runtime"
}
],
"moduleFormats": [
{
"label": "esm",
"documentation": "ESM module format. (Default)"
},
{
"label": "cjs",
"documentation": "CommonJS module format."
}
],
"generatedFileExtensions": [
{
"label": "ts"
},
{
"label": "mts"
},
{
"label": "cts"
}
],
"importFileExtension": [
{
"label": "ts"
},
{
"label": "mts"
},
{
"label": "cts"
},
{
"label": "js"
},
{
"label": "mjs"
},
{
"label": "cjs"
},
{
"label": "",
"documentation": "For bare imports."
}
],
"compilerBuild": [
{
"label": "fast",
"documentation": "Faster query execution. Larger bundle size."
},
{
"label": "small",
"documentation": "Smaller bundle size. Slower query execution."
}
],
"runtimeArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "Specifies the target runtime environment."
}
],
"moduleFormatArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "Determines whether `import.meta.url` or `__dirname` is used."
}
],
"generatedFileExtensionArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "File extension for generated TypeScript files."
}
],
"importFileExtensionArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "File extension used in import statements."
}
],
"compilerBuildArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "The build of the query compiler to use."
}
],
"datasourceProviders": [
{
"label": "mysql",
"documentation": "Specifies a MySQL datasource. Learn more about this connector [here](https://pris.ly/d/mysql-connector)."
},
{
"label": "postgresql",
"documentation": "Specifies a PostgreSQL datasource. Learn more about this connector [here](https://pris.ly/d/postgresql-connector)."
},
{
"label": "sqlite",
"documentation": "Specifies a SQLite datasource. Learn more about this connector [here](https://pris.ly/d/sqlite-connector)."
},
{
"label": "sqlserver",
"documentation": "Specifies a Microsoft SQL Server datasource. Learn more about this connector [here](https://pris.ly/d/sqlserver-connector)."
},
{
"label": "mongodb",
"documentation": "Specifies a MongoDB datasource. Learn more about this connector [here](https://pris.ly/d/mongodb-connector)."
},
{
"label": "cockroachdb",
"documentation": "Specifies a CockroachDB datasource. Learn more about this connector [here](https://pris.ly/d/cockroachdb-connector)."
}
],
"datasourceProviderArguments": [
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "Specifies a single provider."
}
],
"previewFeaturesArguments": [
{
"label": "[]",
"insertText": "[$0]",
"documentation": "Enables preview feature flags."
},
{
"label": "\"\"",
"insertText": "\"$0\"",
"documentation": "Enables a preview feature flag."
}
],
"relationModeValues": [
{
"label": "foreignKeys",
"insertText": "foreignKeys",
"documentation": "Default value. The relation will use the Foreign Keys from the database."
},
{
"label": "prisma",
"insertText": "prisma",
"documentation": "The relation will not use Foreign Keys from the databse. Prisma Client will emulate their behavior for update and delete queries. [Learn more](https://pris.ly/d/relationMode)"
}
]
}