Prisma

Latest version: v0.15.0

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 14 of 44

3.9.0

Today, we are excited to share the `3.9.0` stable release 🎉

🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v3.9.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.9.0) about the release.** 🌟

Major improvements and new features

Prisma Migrate improvements to troubleshoot migrations

Last year, we released Prisma Migrate for General Availability. Since then, we've gotten feedback from you to understand the challenges you experience building, testing, and deploying migrations.

We're thrilled to announce that we're introducing new CLI commands to improve the experience troubleshooting migrations:

- `prisma migrate diff`
- `prisma db execute`

The `prisma migrate diff` command creates a diff of your database schema, Prisma schema file, or the migration history. All you would have to do is feed the command with a schema `from` state and a schema `to` state to get an SQL script or human-readable diff in return.

As a companion to the `prisma migrate diff`, we also built `prisma db execute` to execute SQL scripts against a database. You can pipe the output from `prisma migrate diff` directly to `prisma db execute`.

Both commands are non-interactive, so it's possible to build many new workflows such as forward and backward migrations with some automation tooling.

Both commands are in Preview, and we are looking forward to learning how they work for you and how we could make them better.

You can learn about them [here](https://www.prisma.io/docs/guides/database/production-troubleshooting#fixing-failed-migrations-with-migrate-diff-and-db-execute) and give us feedback on the [issue](https://github.com/prisma/prisma/issues/11514).

Preview support for CockroachDB


We are excited to announce [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) support for CockroachDB :tada:

[CockroachDB](https://www.cockroachlabs.com/) is a distributed SQL database that shines in its ability to scale efficiently while maintaining developer agility and reducing operational overhead.

CockroachDB support in Prisma is the product of collaboration with the [Cockroach Labs](https://www.cockroachlabs.com/) team, and with this release you can use Prisma in existing CockroachDB projects with introspection.

- Learn more in the [release blog post](https://www.prisma.io/blog/prisma-preview-cockroach-db-release)
- Try it out with the [getting started guide](https://prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-cockroachdb)
- [Share your feedback](https://github.com/prisma/prisma/issues/11542)
- Join us this Thursday for [What's new in Prisma 3.9.0](https://www.youtube.com/watch?v=lqiGj02WVqo) where [Aydrian Howard](https://twitter.com/itsaydrian) from Cockroach Labs will be joining us to discuss CockroachDB and give a demo.

Raw query support for MongoDB

Prisma version `3.9.0` introduces raw queries to the MongoDB (Preview) connector. Raw queries help writing queries that Prisma doesn't support yet, such as:

ts
// To find zero or more documents matching a filter
const result = await prisma.user.findRaw({
filter: { age: { $gt: 25 } },
options: { projection: { _id: false } },
})

// To perform aggregation operations on a collection
await prisma.user.aggregateRaw({
pipeline: [
{ $match: { status: 'registered' } },
{ $group: { _id: '$country', total: { $sum: 1 } } },
],
})

// To run a command against the database
await prisma.$runCommandRaw({
aggregate: 'User',
pipeline: [
{ $match: { name: 'Bob' } },
{ $project: { email: true, _id: false } },
],
explain: false,
})


The raw query API for MongoDB differs from Prisma's `$queryRaw` SQL API to handle some low-level differences between databases to give you a better API and developer experience.

Learn more about Prisma's new raw query API and how you can use it in our [documentation](https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#raw-queries-with-mongodb).

Concurrency issues with Interactive Transactions

In `3.9.0`, we fixed a [number of issues](https://github.com/prisma/prisma/issues/8707) around timeouts and rollbacks when there were concurrent reads and writes.

This is part of the [Interactive Transactions preview release](https://github.com/prisma/prisma/issues/8664), so you'll need to enable the `interactiveTransactions` preview feature to enable this feature.

If you experienced timeouts or your interactive transactions weren't working quite as you expected, now's the time to upgrade and give it another go!

Learn more about Interactive Transactions in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/transactions#interactive-transactions-in-preview).

Fixes and improvements

Prisma Client

- [Make the MongoDB Replica Set Requirement Optional in Development](https://github.com/prisma/prisma/issues/8266)
- [Enable raw query support in MongoDB](https://github.com/prisma/prisma/issues/8270)
- [interactiveTransactions: 2 concurrent writes to the same row will cause it to hang until expiring](https://github.com/prisma/prisma/issues/8707)
- [interactiveTransactions rollback but don't error out if timeout is reached](https://github.com/prisma/prisma/issues/9533)
- [PCO: Pass the trace ID through to an SQL comment](https://github.com/prisma/prisma/issues/10004)
- [prisma.$transaction: Benchmark produces unexpected results](https://github.com/prisma/prisma/issues/10218)
- [Snapshot serializer in CLI tests doesn't replace time durations >= 1s with a placeholder](https://github.com/prisma/prisma/issues/10896)
- [prisma/sdk v3.8.0: Cannot find module 'fs-jetpack'](https://github.com/prisma/prisma/issues/11126)
- [Integrate MongoDB raw queries](https://github.com/prisma/prisma/issues/11136)
- [Incorrect type for `DMMF.Field.type` field](https://github.com/prisma/prisma/issues/11202)
- [Remove internal UDS option and tests from client](https://github.com/prisma/prisma/issues/11240)
- [Internal request: have a way to get types string from dmmf](https://github.com/prisma/prisma/issues/11295)


Prisma Migrate

- [Unhide `cockroachdb` provider and preview feature flag](https://github.com/prisma/prisma/issues/10808)
- [Cannot find module 'fs-jetpack' with prisma 3.8.0](https://github.com/prisma/prisma/issues/11112)
- [[CDB] Test and improve Default Value Introspection](https://github.com/prisma/prisma/issues/11167)
- [Migrate command does not create fulltext index [MySQL]](https://github.com/prisma/prisma/issues/11177)
- [MySQL conversion issues on Windows with version 8.0.28](https://github.com/prisma/prisma/issues/11264)

Prisma Studio

- [Can't view any models: ENOENT error no such file or directory when the Prisma schema filename is not `schema.prisma`](https://github.com/prisma/studio/issues/819)

Prisma Engines

- [Update MongoDB to `2.1.0` (latest)](https://github.com/prisma/prisma-engines/issues/2596)

Credits

Huge thanks to dusandz, hyochan, cesconix, benkroeger, YassinEldeeb, chenkie, Akxe, safareli for helping!

Change in release cadence

We're making a slight change to our release cadence to every 3 weeks from every 2 weeks.

📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=lqiGj02WVqo) livestream.

The stream takes place [on YouTube](https://www.youtube.com/watch?v=lqiGj02WVqo) on **Thursday, February 03** at **5 pm Berlin | 8 am San Francisco**.

3.8.1

Today, we are issuing the `3.8.1` patch release.

Fixes

- [prisma/sdk v3.8.0: Cannot find module 'fs-jetpack'](https://github.com/prisma/prisma/issues/11126)

3.8.0

Today, we are excited to share the `3.8.0` stable release 🎉

🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v3.8.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.8.0) about the release.** 🌟

Major improvements and new features

Full-text search support for MySQL is now in Preview 🚀

We're back from the holidays with a special treat for you.

Prisma now supports full-text search in MySQL. You can enable full-text support by adding the `fullTextIndex` and `fullTextSearch` Preview flags in your Prisma schema and defining `fulltext()` indexes on fields you'd like to use full-text search on.

prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextIndex", "fullTextSearch"]
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}

model Post {
id Int id default(autoincrement())
title String unique
fulltext([title])
}


Run `prisma db push` or `prisma migrate dev` to update your database schema. Prisma Client will also be re-generated, enabling you to use full-text search in your application.

typescript
// search for titles that contain cat, but not fox
await prisma.post.findMany({
where: {
title: {
search: "+cat -fox",
},
},
})


Learn more in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/full-text-search).

`dataProxy` and `interactiveTransactions` Preview Features are now mutually exclusive

Before Prisma `3.8.0`, Prisma `$transaction` queries would fail whenever the Data Proxy and Interactive Transactions Preview features were used together. The `interactiveTransactions` and `dataProxy` Preview flags cannot be used together in this release. Generating the Prisma Client when both Preview features are enabled will throw an error.

Fixed support for `push` when adding an element to an array in MongoDB

In `3.8.0`, we fixed [`push`](https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#push) support for `ObjectId`s on MongoDB.

Given the following schema:

prisma
model Course {
id String id default(dbgenerated()) map("_id") db.ObjectId
title String
students String[] db.Array(ObjectId)
}


You can now run the following query:

typescript
// Add a new student to the course
await prisma.course.update({
where: {
id: 1
},
data: {
students: {
push: new ObjectID("...")
}
}
})


A special thanks to [Anthony Luzquiños](https://github.com/AnthonyLzq) for raising this issue!

Fixes and improvements

Prisma Migrate

- [map field name swap causes "Field is already defined on model" error](https://github.com/prisma/prisma/issues/8687)
- [`generator.engineType` is not validated](https://github.com/prisma/prisma/issues/9120)
- [Migrate creates unnecessary migration with SQL syntax error](https://github.com/prisma/prisma/issues/9204)
- [Using datasource property that requires preview feature, highlights only value and not property in validation error](https://github.com/prisma/prisma/issues/9314)
- [Index `name` validations](https://github.com/prisma/prisma/issues/10082)
- [Postgres - 63 chars limit for index name](https://github.com/prisma/prisma/issues/10094)
- [IE: Not recognizing string type](https://github.com/prisma/prisma/issues/10347)
- [`previewFeatures = []` gets lost after Introspection](https://github.com/prisma/prisma/issues/10460)
- [Prisma format adds invalid fragments to schema if composites are present on a model](https://github.com/prisma/prisma/issues/10845)
- [`migrate dev` fails on second run with specific schema](https://github.com/prisma/prisma/issues/10983)
- [Error: [C:\\.cargo\registry\src\github.com-1ecc6299db9ec823\tiberius-0.6.4\src\tds\codec\pre_login.rs:129:22] unsupported prelogin token: 2 ](https://github.com/prisma/prisma/issues/11009)


Prisma Client

- [MDBE: Design document for adding `type` support to the Query Engine](https://github.com/prisma/prisma/issues/9360)
- [Changing prisma query params using middleware doesn't work](https://github.com/prisma/prisma/issues/9522)
- [Implement Mysql Fulltext Querying Capabilities](https://github.com/prisma/prisma/issues/10415)
- [MongoDB referentialActions in m-n relationships](https://github.com/prisma/prisma/issues/10498)
- [`Error querying the database: db error: ERROR: unsupported startup parameter: options`](https://github.com/prisma/prisma/issues/10841)
- [How to push a new ObjectId to an array?](https://github.com/prisma/prisma/issues/10906)
- [`prisma/client` intermittently added and removed from `transitivePeerDependencies` in lockfile](https://github.com/prisma/prisma/issues/10973)

Language tools (e.g. VS Code)

- [Provider-aware auto-completion is not applied to all auto completions](https://github.com/prisma/language-tools/issues/942)
- [Add configuration option to turn off file watcher](https://github.com/prisma/language-tools/issues/944)
- [VSCode plugin formatting no longer uses editor `tabSize` configuration when indenting blocks](https://github.com/prisma/language-tools/issues/993)


Prisma Studio

- [warn(prisma-client) Already 10 Prisma Clients are actively running.](https://github.com/prisma/studio/issues/800)
- [`BigInt` breaks studio](https://github.com/prisma/studio/issues/802)
- [Model named "id"](https://github.com/prisma/studio/issues/806)


Credits

Huge thanks to hyochan, cesconix for helping!

📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=c236Qv1wBIU) livestream.

The stream takes place [on YouTube](https://www.youtube.com/watch?v=c236Qv1wBIU) on **Thursday, January 13** at **5 pm Berlin | 8 am San Francisco**.

3.7.0

Today, we are excited to share the `3.7.0` stable release 🎉

🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v3.7.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.7.0) about the release.** 🌟

Major improvements

Referential actions support for MongoDB

In `3.7.0`, we've added MongoDB support for `onDelete` and `onUpdate` to specify how you want to handle changes to relationships.

MongoDB does not support referential actions out of the box, but we can emulate this feature inside the Prisma Query Engine.

Given the following schema:

diff
model User {
id String id default(dbgenerated()) map("_id") db.ObjectId
posts Post[]
name String
}

model Post {
id String id default(dbgenerated()) map("_id") db.ObjectId
+ author User relation(fields: [userId], references: [id], onDelete: Cascade)
- author User relation(fields: [userId], references: [id])
title String
userId String db.ObjectId
}


By specifying `onDelete: Cascade`, Prisma will also delete posts whenever the author of the posts is deleted. There's a lot more to referential actions than cascading deletes. Head over to [our documentation](https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions) to learn more.

Prisma exposes features and workflows that database vendors don't offer.

Prevent referential cycles on MongoDB

As part of getting `onDelete` and `onUpdate` ready for MongoDB, we’ve tightened up our validation rules to prevent a potential stack overflow if you create a loop with referential actions.

This change may cause some existing schemas using the `mongodb` preview feature to become invalid, where your schema now errors out with the following message:

bash
Error parsing attribute "relation": Reference causes a cycle.


If you run into this, you can learn how to resolve it with [this documentation](https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions/special-rules-for-referential-actions). If you’re still stuck, feel free to open [a discussion](https://github.com/prisma/prisma/discussions/new) and we’ll lend a hand!

Deprecating undocumented usage of `type` in Prisma Schema

With Prisma `3.7.0` release, the [Prisma VS Code extension](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) (and other IDEs using our [language server implementation](https://www.npmjs.com/package/prisma/language-server)) will start to show a warning when detecting unsupported usage of the `type` keyword.

An example of that is string aliasing:

prisma
type MyId = String id default(dbgenerated(new_uuid()))

model A {
id MyId
}


We plan to remove that functionality entirely with the next major release of Prisma. If you happen to depend on similar functionality for type aliasing, please leave a comment on the [issue](https://github.com/prisma/prisma/issues/9939).

Prisma Studio

- Due to how Prisma Studio executes Prisma Client queries, it was possible to execute arbitrary code on Studio’s local server. This has since been patched.
- Issues with viewing and updating models with `BigInt` fields are also resolved.
Fixes and improvements

Prisma Client

- [Run (most) tests on all operating system](https://github.com/prisma/prisma/issues/7725)
- [EPERM: operation not permitted, unlink '...node_modules\prisma\query_engine-windows.dll.node'](https://github.com/prisma/prisma/issues/9184)
- [Overflowing stack on cyclic actions](https://github.com/prisma/prisma/issues/9931)
- [Implement a cockroachdb datamodel connector (Validations, for Prisma Client API adaptations)](https://github.com/prisma/prisma/issues/10514)
- ["No X found" error thrown from a findUnique query does not show a stack trace](https://github.com/prisma/prisma/issues/10641)

Prisma Migrate

- [SQL Server: `prisma generate` fails with error "memory allocation of [86GB] failed"](https://github.com/prisma/prisma/issues/10621)

Language tools (e.g. VS Code)

- [Auto completion work for "Expanded Index Capabilities"](https://github.com/prisma/language-tools/issues/926)
- [Make auto completion preview feature flag aware](https://github.com/prisma/language-tools/issues/962)
- [The package-lock.json file was created with an old version of npm](https://github.com/prisma/language-tools/issues/969)
- [prisma-fmt panic on schema with `fulltext(fields:[])` or `fulltext([])` or `index([])` or `unique([])`.](https://github.com/prisma/language-tools/issues/995)

Credits

Huge thanks to otan, benkroeger, YassinEldeeb, chenkie for helping!

📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma Holiday Special"](https://youtu.be/ohS25OtGdsc) livestream.

The stream takes place [on YouTube](https://youtu.be/ohS25OtGdsc) on **Tuesday, December 21** at **5 pm Berlin | 8 am San Francisco**.

3.6.0

Today, we are excited to share the `3.6.0` stable release 🎉

🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v3.6.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.6.0) about the release.** 🌟 

Major improvements & new features

Prisma Migrate

Full-text index support in MySQL and MongoDB (Preview)

In this version we introduce support for full-text indexes in the `db pull`, `db push` and `migrate` commands for MySQL and MongoDB databases as a [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) feature. This allows using them in the Prisma schema and prevents validation errors in some database schemas.

For now we do not enable the full-text search commands in the Prisma Client. They will be implemented separately, and the progress can be followed in the [MongoDB](https://github.com/prisma/prisma/issues/9413) and [MySQL](https://github.com/prisma/prisma/issues/10415) issues.

Add the preview feature `fullTextIndex` to the Prisma schema, after which the `fulltext` attribute is allowed in the Prisma schema:

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

model A {
id Int id
title String db.VarChar(255)
content String db.Text

fulltext([title, content])
}


Please note that it is mandatory to do `db pull` with the preview feature enabled before using Prisma Migrate on existing MySQL databases, so the index types can be converted and will not get overwritten in the next migration.

For more details check out our [documentation](https://www.prisma.io/docs/concepts/components/prisma-schema/index-configuration).

Hash index support for PostgreSQL (Preview)

With the `extendedIndexes` preview feature, it is now possible to use `Hash` instead of the default `BTree` as the index algorithm on PostgreSQL databases. A hash index can be much faster for inserts, but it only supports equals operation in the database.

An example of using a hash index:

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

model A {
id Int id
value Int

index([value], type: Hash)
}


For more details check out our [documentation.](https://www.prisma.io/docs/concepts/components/prisma-schema/index-configuration)


VS Code extension now uses a Wasm module

Until this release, the language server powering the [Prisma VS Code extension](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) relied on logic from the Prisma engines in the form of a native binary. Downloading and running the native binary required a large amount of custom logic and led to problems due to network failures, operating system permissions and malicious code detection issues.

Starting with `3.6.0`, the language server and the VS Code extension use logic compiled to [WebAssembly](https://webassembly.org/) and distributed through npm. There is no runtime binary download and no external process involved anymore. We expect this new distribution model to be more robust and hence provide a better experience for our users.

If you have any feedback, please leave an issue in the [`prisma/language-tools`](https://github.com/prisma/language-tools/) repository.

Prisma Client

`Bytes` can now be filtered with `in` and `notIn`

You can now use `in` and `notIn` operations on the `Bytes` type:

ts
const audioTracks = raws.map(raw => {
return Buffer.from(raw)
})

const result = await prisma.audio.find({
where: {
track:
in: audioTracks
}
}
})


Thanks [serejkaaa512](https://github.com/serejkaaa512) for [your contribution](https://github.com/prisma/prisma-engines/pull/2418)!

`Json` fields now accept read-only types

This is a small quality-of-life improvement. You can now pass immutable values into `Json` fields. In the following example, `audit` is a `Json` field that accepts a read-only array:

ts
const trail = [
{ event: "signup" },
{ event: "subscribe" },
{ event: "invite friend" }
] as const

await prisma.user.create({
data: {
audit: trail
}
})


Learn more in [this issue](https://github.com/prisma/prisma/issues/10165).

Reducing interactive transactions timeouts for binary engine

If you've spent some time using the new [Interactive Transaction API](https://www.prisma.io/docs/guides/performance-and-optimization/prisma-client-transactions-guide#interactive-transactions-in-preview) with the binary engine, you may have encountered this timeout error:


Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired'.


This could happen if you had two concurrent requests modifying the same resource at the same time using the binary engine type.

It took us a while to track down the source of this error, but it turned out to be a low-level misconfiguration in our HTTP client. We [disabled HTTP pipelining](https://github.com/prisma/prisma/pull/10295) to fix this problem.

Fix `notIn` filters for large queries

This most likely didn't affect you, but if you ever tried using `notIn` with a large query, you may have received an incorrect result.

The query engine automatically breaks up large queries into smaller queries and intersects the results. Most of the time this works as expected but for certain queries like `notIn`, the intersection of results is incorrect.

We fixed this in `3.6.0`. You can now use `in` and `notIn` operations on the `Bytes` type:

ts
const denyList = [/* ... large list of user ids ... */]
const result = await prisma.user.findMany({
where: {
id: {
notIn: denyList
}
}
})


This query will break up the query into chunks that your database can manage:

sql
select * where User not in ($1,$2, ..., $5000)
select * where User not in ($1000,$1001, ..., $6000)


... and return the correct results. Learn more in [this issue](https://github.com/prisma/prisma/issues/7434).


Fixes and improvements

Prisma Client

- [interactiveTransactions: 2 concurrent writes to the same row will cause it to hang until expiring](https://github.com/prisma/prisma/issues/8707)
- [Please support having `in` natively for bytes](https://github.com/prisma/prisma/issues/8854)
- [[MongoDB] Can not query data from MongoDB Atlas serverless cluster/database, weird error `The provided database string is invalid. Invalid MongoDB connection string in database URL.` instead](https://github.com/prisma/prisma/issues/9682)
- [Know when the Client is using the data proxy](https://github.com/prisma/prisma/issues/9958)
- [PCO: Setup an example Node.js application with OpenTelemetry that posts to a Tracing UI](https://github.com/prisma/prisma/issues/10002)
- [Support order by relevance](https://github.com/prisma/prisma/issues/10066)
- [JSONValue not accepting readonly array or objects](https://github.com/prisma/prisma/issues/10165)
- [Downloading binaries fails with wrong sha256 checksum ](https://github.com/prisma/prisma/issues/10312)

Prisma Migrate

- [Full-Text Search Index support for MySQL](https://github.com/prisma/prisma/issues/9412)
- [Specification of Index Type](https://github.com/prisma/prisma/issues/10080)
- [Add timing information to Migration CLI output](https://github.com/prisma/prisma/issues/10106)
- [Seeding fails in `prisma migrate dev` with timeout but works with `prisma db seed`](https://github.com/prisma/prisma/issues/10194)
- [`dbgenerated` migrations in MySQL are broken (since 3.4.x)](https://github.com/prisma/prisma/issues/10275)
- [seed.sh is executed before migration has completed when using prisma migrate dev](https://github.com/prisma/prisma/issues/10417)

Language tools (e.g. VS Code)

- [Missing License.md](https://github.com/prisma/language-tools/issues/964)
- [Re-introduce error handling to referentialActions() and nativeTypes() methods in prisma-fmt](https://github.com/prisma/language-tools/issues/965)

Prisma engines

- [Refactor ConnectorCapability::ForeignKeys to ReferentialIntegrity checks](https://github.com/prisma/prisma-engines/issues/2396)

Credits

Huge thanks to Akxe, safareli for helping!

📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=12c1geyFOt4) livestream.

The stream takes place [on YouTube](https://www.youtube.com/watch?v=12c1geyFOt4) on **Thursday, December 02** at **5pm Berlin | 8am San Francisco**.

3.5.0

Today, we are excited to share the `3.5.0` stable release 🎉

🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v3.5.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.5.0) about the release.** 🌟 

Major improvements & new features

Order by relevance in full text search (PostgreSQL)

In `3.5.0`, we've added support for ordering full text search results by _relevance_. Ordering by relevance gives you a way to order search results by the best match. You can enable order by relevance and full-text search with the `fullTextSearch` feature flag:

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

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model People {
id Int id default(autoincrement())
bio String
}


While this feature is useful standalone, it's most commonly used in combination with the full text `search` field in the `where` clause:

tsx
const query = "node.js developer"
const developers = await prisma.people.findMany({
where: {
bio: {
// Only select people whose bio's contain "node.js developer"
search: query,
},
},
orderBy: {
// Order that selection by query relevance.
_relevance: {
fields: ["bio"],
search: query,
sort: "desc",
},
},
})


Learn more in [our documentation](https://prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#sort-by-relevance-postgresql) and if you run into any issues or have feedback for us, you can reach us in [this issue](https://github.com/prisma/prisma/issues/8877).

More configuration options for indexes and constraints in the Prisma schema (Preview)

We are extending the syntax in the Prisma schema to add support for _configuration of length_ and _sort order_. This applies to:

- indexes
- unique constraints
- primary key constraints

These new configuration options come with full support for the `prisma db pull`, `prisma db push` and `prisma migrate dev` commands, so index configuration can now be managed, evolved and deployed using Prisma's schema management tooling.

Two new arguments can now be specified per field:

- `length` (the maximum length of items in the index)
- `sort` (how an index is sorted)

In order to use these new capabilities, add the `extendedIndexes` feature flag in the generator block:

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


The change affects the `id`, `id`, `unique`, `unique` and `index` fields in certain databases:

- The `length` argument is available on MySQL on the `id`, `id`, `unique`, `unique` and `index` fields. It allows Prisma to now support indexes and constraints on `String` with a `TEXT` native type and `Bytes` types.
- The `sort` argument is available for all databases on the `unique`, `unique` and `index` fields. Additionally, SQL Server also allows it on `id` and `id`.

The following example demonstrates the use of the `sort` and `length` arguments:

prisma
model Post {
title String db.VarChar(300)
abstract String db.VarChar(3000)
slug String db.VarChar(3000) unique(sort: Desc, length: 42)
author String
created_at DateTime

id([title(length: 100, sort: Desc), abstract(length: 10)])
index([author, created_at(sort: Desc)])
}


> ⚠️ **Warning:** This might be a _breaking change_ for some users. To learn how to mitigate that, please read the documentation linked below.

Learn more in the documentation on [index configuration](https://www.prisma.io/docs/concepts/components/prisma-schema/index-configuration).

Case insensitive filtering for Prisma Client Go

We've had this feature in the Prisma Client JS for awhile, but in this release, we've added case-insensitive query support to the Go Client as well. Now you can worry a bit less about what kind of data the user is going to send your way.

go
users, err := client.User.FindMany(
User.Email.Equals("prisMa"),
User.Email.Mode(QueryModeInsensitive), // sets case insensitivity
).Exec(ctx)


Learn more in [our documentation](https://github.com/prisma/prisma-client-go/blob/main/docs/features/casing.md).

Fixes and improvements

Prisma Client

- [Postgres Native Types: Improve error when `uuid` is invalid](https://github.com/prisma/prisma/issues/4060)
- [Implement missing Mongo referential actions emulation](https://github.com/prisma/prisma/issues/9014)
- [Type of `_count` key of relation count is nullable](https://github.com/prisma/prisma/issues/9416)
- [CFW: Add E2E tests](https://github.com/prisma/prisma/issues/9596)
- [Improve Connection Pool Timeout error message](https://github.com/prisma/prisma/issues/9662)
- [Prisma Client: Query Engine `engineType=binary` incompatible with Node.js v17?](https://github.com/prisma/prisma/issues/9903)
- [CI: Test on Node.js Active LTS v16](https://github.com/prisma/prisma/issues/10022)
- [After upgrading from 3.2.1 to 3.3.0 I get a 'Error: Cannot find module 'os''](https://github.com/prisma/prisma/issues/10058)
- [Data Proxy client fails when multi-byte chars are used](https://github.com/prisma/prisma/issues/10152)


Prisma Migrate

- [Commented out env var values from `.env` are logged via `DEBUG=*`](https://github.com/prisma/prisma/issues/9428)
- [`db push` crashes on SQL Server because of `Error: There is already an object named 'Post_authorId_fkey' in the database.`](https://github.com/prisma/prisma/issues/9537)
- [[PSL] Expanded Index Capabilities](https://github.com/prisma/prisma/issues/9577)
- [MongoDB: Cannot create m-n relations](https://github.com/prisma/prisma/issues/10071)
- [Implement a new `cockroachdb` provider in the Schema Parser](https://github.com/prisma/prisma/issues/10079)

Prisma Engines

- [Update prisma-engines README](https://github.com/prisma/prisma-engines/issues/2295)


Language tools (e.g. VS Code)

- [Auto completion support for `engineType = "dataproxy"` or similar](https://github.com/prisma/language-tools/issues/886)
- ["before all" hook in "Completions": Error: Timeout of 2000ms exceeded.](https://github.com/prisma/language-tools/issues/924)
- [Decide on and prototype provider aware auto completion](https://github.com/prisma/language-tools/issues/927)


🎉 The Serverless Data Conference is happening on Thursday (Nov 18)

Join us for the first [Prisma Serverless Data Conference](https://www.prisma.io/serverless) about all things **databases and serverless**. Here's an overview of the speakers at the conference:

- Kevin Jernigan, **MongoDB**
- Greg McKeon, **Cloudflare**
- Jason Lengstorf, **Netlify**
- Sugu Sougoumarane and Taylor Barnett, **PlanetScale**
- Aydrian Howard, **CockroachDB**
- Hassan El Mghari, **Vercel**

In addition to these fantastic talks, you can look forward to the **Prisma keynote** with a lot of information about the current status and upcoming plans for the [Prisma Data Platform](https://www.prisma.io/docs/concepts/components/prisma-data-platform).

📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=2uOzqjFBSEQ&ab_channel=Prisma) livestream.

The stream takes place [on Youtube](https://www.youtube.com/watch?v=2uOzqjFBSEQ&ab_channel=Prisma) on **Wednesday, November 17** at **5pm Berlin | 9am San Francisco**.

> **Note**: We usually stream on Thursdays, but **this week we have moved the stream to Wednesday** to leave space for the Serverless Data Conference on Thursday.

Page 14 of 44

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.