v2.1.3 🎉
🌟 Help us spread the word about Prisma ORM for Dart by starring the repo or Tweeting about the release. 🌟
Major improvements:
- refactor
PrismaClientKnownRequestError
, Prisma Client throws a PrismaClientKnownRequestError exception if the query engine returns a known error related to the request - for example, a unique constraint violation. Reference 👉 PrismaClientKnownRequestError - All exceptions on the client side will throw predictable errors,Reference 👉 PrismaClientKnownRequestError
query_engine
renamed toengine_core
Better error message
Take transaction errors as an example, before simply throwing PrismaServerError
without any friendly prompts. Now:
PrismaClientUnknownRequestError:
Use the `prisma.$transaction()` API to run queries in a transaction.
Add the following to your `schema.prisma` file:
generator client {
provider = "prisma-client-js"
previewFeatures = ["interactiveTransactions"]
}
Read more about transactions in our documentation:
- https://github.com/odroe/prisma-dart#qa
- https://www.prisma.io/docs/concepts/components/prisma-client/transactions#interactive-transactions-in-preview
If the engine is not found:
PrismaClientInitializationError:
message: Could not find query engine binary for current platform "macos" in query-engine path.
This probably happens, because you built Prisma Client on a different platform.
Searched Locations:
- /Users/seven/workspace/prisma/example
- /Users/seven/workspace/prisma/example/.dart_tool/prisma
- /Users/seven/workspace/prisma/example/prisma
- /Users/seven/workspace/prisma/example/.dart_tool/pub/bin/example
You already added the platform "macos" to the "generator" block in the "schema.prisma" file as described in https://pris.ly/d/client-generator, but something went wrong. That's suboptimal.
Please create an issue at https://github.com/odroe/prisma-dart/issues/new
errorCode: null
clientVersion: 2.1.2
$transaction
options
prisma.$transaction
now supports the following options:
final prisma = PrismaClient();
await prisma.$transaction((prisma) async {
// ...
}, TransactionOptions(
maxWait: 2000,
timeout: 5000,
isolationLevel: TransactionIsolationLevel.ReadUncommitted,
));
More details 👉 Interactive transactions
Bug fixes
- Fixed
packageVersion
not updating with version - Fixed binary query engine not automatically searching when
executable
is specified - Fixed binary query engine not automatically searching when specifying
PRISMA_QUERY_ENGINE_BINARY
environment variable
Engines version
c875e43600dfe042452e0b868f7a48b817b9640b