`Bytes` not allowed as `@id` field when using SQL Server
See original GitHub issueBug description
Prisma will not validate a schema that uses a Bytes @id
field and a provider
of sqlserver
.
How to reproduce
- Use the
sqlserver
provider
- Add a model field with type
Bytes
and the@id
attribute - Run
prisma generate
Expected behavior
Bytes @id
fields are allowed in other providers and should be possible with SQL Server
Prisma information
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlserver"
url = "connection string"
}
model Foo {
bar Bytes @id
}
Environment & setup
- OS: macOS 13.0
- Database: SQL Server
- Node.js version: 18.7.0
Prisma Version
prisma : 4.5.0
@prisma/client : 4.5.0
Current platform : darwin-arm64
Query Engine (Node-API) : libquery-engine 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine : migration-engine-cli 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine : introspection-core 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary : prisma-fmt 0362da9eebca54d94c8ef5edd3b2e90af99ba452 (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Format Wasm : @prisma/prisma-fmt-wasm 4.5.0-43.0362da9eebca54d94c8ef5edd3b2e90af99ba452
Default Engines Hash : 0362da9eebca54d94c8ef5edd3b2e90af99ba452
Studio : 0.476.0
Preview Features : interactiveTransactions, fieldReference
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (5 by maintainers)
Top Results From Across the Web
is of a type that is invalid for use as a key column in an index
The only solution is to use less data in your Unique Index. Your key can be NVARCHAR(450) at most. "SQL Server retains the...
Read more >Maximum capacity specifications for SQL Server
This article shows maximum sizes and numbers of various objects defined in SQL Server components, along with additional information.
Read more >How to solve the SQL Identity Crisis in SQL Server
This article gives an overview of SQL Identity crisis and method to resolve it.
Read more >SQL Data Types for MySQL, SQL Server, and MS Access
String Data Types ; BINARY(size), Equal to CHAR(), but stores binary byte strings. The size parameter specifies the column length in bytes. Default...
Read more >SQLSTATE values and common error codes - IBM
A triggered SQL statement failed. Table 8. Class Code 0A: Feature Not Supported. SQLSTATE Value, Meaning ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On SQL Server 2019, the following is valid
but it results in an invalid schema (schema validation error)
I’ll try this in a bit to confirm it