Changes
cluster
, service
, stage
and schema
final removal
This version doesn't support the cluster
, service
, stage
and schema
properties anymore. The cluster
, service
and stage
properties are being replaced by endpoint
, as already announced in 1.7.
Prisma Client & generate
command
This release includes the new Prisma Client. The Prisma Client is a generated client for the languages JavaScript, TypeScript, Flow and Go. It can be generated by adding a generate
property to the prisma.yml:
datamodel: datamodel.graphql
endpoint: http://localhost:4466
generate:
- generator: typescript-client
output: ./src/generated/prisma
With the prisma generate
command, the client will now be generated and can be used like this:
import { prisma } from './generated/prisma'
const uersers = await prisma.users()
Raw database access fallback
Prisma exposes a flexible API that conforms to the OpenCRUD specification.
This API has excellent developer ergonomics and is powerful enough to cover most use cases. Sometimes, however you need to drop down to the native API of the underlying database to perform a more complex operation. This raw access feature has been implemented now (prisma/prisma#2052). This feature is available in the executeRaw
mutation:
mutation {
executeRaw(
database: default,
query: "SELECT TOP(10) FROM Users ORDER BY uuid()"
)
}