Hey <!everyone> :v: :prisma-cool: We just release...
# prisma-whats-new
a
Hey <!everyone> โœŒ๏ธ prisma cool We just released Prisma
3.14.0
prisma rainbow ๐Ÿฆฆ CockroachDB connector is now Generally Available! We are proud to announce that the CockroachDB connector is now stable and Generally Available. If youโ€™re upgrading from Prisma version `3.9.0`+ or the PostgreSQL connector, you can now run
npx prisma db pull
and review the changes to your schema. To learn more about CockroachDB-specific native types we support, refer to our docs. To learn more about the connector and how it differs from PostgreSQL, head to our documentation. โšก*๏ธ PostgreSQL
GIN
,
GiST
,
SP-GiST
, and
BRIN
indexes support (Preview)* This release has expanded index type support with the GIN, GiST, SP-GiST, and BRIN indexes. To make use of an index type, you can update your Prisma schema by providing the
type
argument to the
@@index
attribute:
Copy code
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["extendedIndexes"]
}

model Post {
  id      Int     @id
  title   String
  content String?
  tags    Json?
  
  @@index([tags], type: Gin)
}
The following SQL will be generated in your migration when you run `prisma migrate dev`:
Copy code
CREATE TABLE "Post" (
    "id" INTEGER NOT NULL,
    "title" TEXT NOT NULL,
    "content" TEXT,
    "tags" JSONB,
    CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
);

CREATE INDEX "Post_tags_idx" ON "Post" USING GIN ("tags");
To learn more about configuring index types in your schema, refer to our documentation. ๐Ÿช„ Improved
queryRaw
API
In this release, we made improvements to the SQL raw API. Some improvements are breaking and will be available behind the new
improvedQueryRaw
Preview feature flag.
Copy code
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["improvedQueryRaw"]
}
The
improvedQueryRaw
Preview feature solves most of the issues faced when working with the raw API. We would encourage you to turn on the Preview feature flag, try out the new API, and let us know how we can make it even better. Here are some of the improvements we made to `queryRaw`: 1. Raw scalar values are deserialized as their correct JavaScript types Prisma Client queries such as
findMany
deserialize database scalar values to their corresponding JavaScript types. For example, a
DateTime
value is deserialized as a JavaScript
Date,
and a
Bytes
would be deserialized as a JavaScript
Buffer
. Raw queries now implement the same behavior when the
improvedQueryRaw
Preview feature flag is enabled. The types of values from the database will be used instead of the types in the Prisma schema. 2. PostgreSQL type-casts Weโ€™ve also fixed a lot of PostgreSQL type-casts that were broken by enabling the
improvedQueryRaw
Preview feature flag. A consequence of this fix is that some subtle implicit casts are now handled more strictly and would fail. 3. Query parameters are correctly sent to the database Before this release, query parameters of type
BigInt
,
Bytes
, and
Decimal
were incorrectly sent to the database leading to instances of unexpected inserts. Passing the types as query parameters now works:
Copy code
await prisma.$executeRaw`INSERT INTO "Table" ("bigint", "bytes", "decimal") VALUES (${BigInt("123")}, ${Buffer.from([1, 2, 3])}, ${Decimal("12.23")});`
This improvement is available without the
improvedQueryRaw
Preview feature flag.
๐Ÿ“š Learn more in the release notes For more info and links to documentation, you can read the release notes. ๐ŸŒŸ Help us spread the word about Prisma ๐ŸŒŸ To help spread the word about Prisma, weโ€™d very much appreciate it if you would star the repo ๐ŸŒŸ And if youโ€™re excited about the features in this weekโ€™s release, then help us and share your excitement on Twitter. ๐Ÿ“ฐ Join us on Thursday for the โ€œWhatโ€™s new in Prismaโ€ livestream This week, @nikolasburk and @Sabin Adams will discuss the latest release and other news from the Prisma ecosystem in a

livestream on YouTubeโ–พ

this Thursday at 5 pm Berlin | 8 am San Francisco.
๐Ÿ‡ณ๐Ÿ‡ฑ 1
gopher love 4
๐Ÿฆœ 51
๐Ÿ‡ฏ๐Ÿ‡ต 8
๐Ÿ‡ต๐Ÿ‡ฑ 6
๐Ÿ”ฅ 19
prisma rainbow 19
๐Ÿš€ 6
โค๏ธ 7
๐Ÿ˜ป 4
๐Ÿ”ฎ 4
fast parrot 39
๐Ÿ™Œ 39
๐ŸŽค 10
๐Ÿ‡ฟ๐Ÿ‡ผ 6
๐Ÿ’ฅ 6
๐Ÿ™Œ๐Ÿผ 2
๐Ÿฆฆ 4
๐Ÿ˜ 6
๐ŸคŸ๐Ÿผ 2
๐Ÿชณ 5
๐ŸŒŸ 4
๐Ÿ‡ฌ๐Ÿ‡พ 2
๐Ÿ‡ฐ๐Ÿ‡ท 10
๐Ÿ‡ฎ๐Ÿ‡ณ 8
๐Ÿ‡ท๐Ÿ‡ด 1
๐Ÿ‡ช๐Ÿ‡น 1
๐Ÿณ๏ธโ€๐ŸŒˆ 10
โœจ 12
๐Ÿ™Œ๐Ÿพ 2
southafrica parrot 3
๐Ÿคฉ 6
๐Ÿ‡ฆ๐Ÿ‡ท 2
๐Ÿ“ฃ 6
prisma cool 7
๐ŸŽ‰ 5
โญ 4
๐Ÿ˜Ž 6
๐ŸŒฏ 4
๐Ÿ‡ฆ๐Ÿ‡บ 2
๐Ÿ‡ฉ๐Ÿ‡ช 2
๐ŸคŸ 3
๐Ÿ‡ช๐Ÿ‡ธ 1
๐Ÿ™Œ๐Ÿฟ 1
๐ŸŒถ๏ธ 5
๐Ÿ’Œ 3
๐Ÿ™Œ๐Ÿป 1
๐Ÿ‡บ๐Ÿ‡ธ 3
india parrot 6
๐Ÿ‡ง๐Ÿ‡ท 3
๐Ÿ‡ฒ๐Ÿ‡ฌ 2