Skip to content

Releases: medz/prisma-dart

3.0.0-beta.1

17 Feb 11:17
Compare
Choose a tag to compare
3.0.0-beta.1 Pre-release
Pre-release
chore(version): 3.0.0-beta.1

🎉 release: v2.6.2

14 Jan 06:08
Compare
Choose a tag to compare
  1. Fixed DateTime to String must be ISO8601 format error - #103
  2. Fixed PrismaNull being serialized as null error.

🎉 release: v2.6.1

10 Jan 07:35
6708244
Compare
Choose a tag to compare
  1. Fixed generated freezed file has undefined class error - #96
  2. generated Prisma Dart Client is now null-safe
  3. Optimize the log parameter for createPrismaClient

🎉 release: v2.6.0

05 Jan 07:20
f0edaaf
Compare
Choose a tag to compare

🌟 Help us spread the word about Prisma ORM for Dart by starring the repo or tweeting about the release. 🌟

New requirements

Breaking change: You are now asked to install the freezed package:

dart pub add freezed -d

Breaking changes

All input classes types will be reset!

The Map input by forJson needs to follow the freezed rules, examples:

final PrismaNull $null = PrismaNull.fromJson({}); // An empty map must be entered to indicate PrismaNull

final UserWhereInput where = UserWhereInput.fromJson({
  'id': {
    'runtimeType': 'withInt', // The runtimeType must be entered, name is `UserWhereInput_id` factory name.
    'value': 1,
  },
});

PrismaUnion has been removed:

Before:

final data = UserCreateInput(
  name: PrismaUnion.zero("Seven"),
);

Now:

final data = CreateOneUserData.withUserCreateInput( // OR `withUserUncheckedCreateInput`
  UserCreateInput(
    name: "Seven",
  ),
);

Note: withUserCreateInput and withUserUncheckedCreateInput are generated by prisma_client.dart file.

Model delegates

All delegat methods input classes are now generated by freezed package, Example(create a user):

Before:

final user = await prisma.user.create(
  data: UserCreateInput(
    name: PrismaUnion.zero("Seven"),
  ),
);

Now:

final user = await prisma.user.create(
  data: CreateOneUserData.withUserUncheckedCreateInput(
    UserUncheckedCreateInput(
      name: 'Seven',
      email: 'seven@odroe.com',
    ),
  ),
);

Seems like it's getting troublesome?

We are preparing to support more Prisma functions in the future, such as REF query.

In addition, we are preparing for the next Dart 3, and we expect that in Dart 3, there is no need to run additional commands before compilation to complete the serialization of input and output types.

Since full input types are relatively cumbersome for web applications, we recommend using the fromJson method to create inputs.

Because the current input is the complete Prisma input type, it is expected to be improved in Dart 3. Currently, Dart 2 does not support union types. Our strategy is to create as many types as possible to meet all Prisma input requirements.

🎉 release: v2.5.1

04 Jan 10:46
Compare
Choose a tag to compare

Support OrThrow methods

Prisma client now supports OrThrow methods.

final User user = await prisma.user.findUniqueOrThrow(...);
final Post post = await prisma.post.findFirstOrThrow(...);

🎉 release: v2.5.0

03 Jan 14:51
Compare
Choose a tag to compare

🌟 Help us spread the word about Prisma ORM for Dart by starring the repo or tweeting about the release. 🌟

Breaking changes

Standalone Prisma client

Prisma client is now exported by orm package and exposes fromEngine constructor.

import 'package:orm/orm.dart';

final PrismaClient prisma = PrismaClient.fromEngine(...);

The generated prisma client now only extends model delegates, and creating a new Prisma client was changed from PrismaClient() to createPrismaClient:

Before:

final PrismaClient prisma = PrismaClient(...);

After:

final PrismaClient prisma = createPrismaClient(...);

Remove preview feature

All previews will be removed and existing Previews will be marked as stable in this release.

Preview will no longer be enabled in future releases, but release *.preview.{num} versions to mark

New features

Support queryRaw and executeRaw methods

Prisma client now supports queryRaw and executeRaw methods.

final PrismaClient prisma = createPrismaClient(...);

final List<Map<String, dynamic>> result = await prisma.$queryRaw('SELECT * FROM User');
final int affectedRows = await prisma.$executeRaw('DELETE FROM User');

Input classes support fromJson method

All input classes now support fromJson method.

final UserCreateInput input = UserCreateInput.fromJson(...);

Engines

  1. Prisma binary engines version updated to d6e67a83f971b175a593ccc12e15c4a757f93ffe
  2. Remote engines version updated to 4.8.0

🎉 release: v2.4.7

03 Jan 03:48
Compare
Choose a tag to compare
  1. Now, Data proxy is stable.
  2. Getting platforms is now supported by prisma_get_platform.

🎉 release: v2.4.6

14 Dec 08:17
Compare
Choose a tag to compare

🌟 Help us spread the word about Prisma ORM for Dart by starring the repo or tweeting about the release. 🌟

Query Engines

  • Data Proxy: Remote client version updated to 4.7.1.
  • Binary: Query engine version updated to 272861e07ab64f234d3ffc4094e32bd61775599c.

Bug Fixes

  • DMMF: The 'name' field of UniqueIndex should be nullable, not non-nullable as incorrectly defined. (#77)

Highlights

Interactive transactions are now Generally Available

Interactive transactions allow you to pass an async function into a $transaction, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.

Before
generator client {
  provider = "prisma-client-dart"
  previewFeatures = ["interactiveTransactions"]
}
Now
generator client {
  provider = "prisma-client-dart"
}

🎉 release: v2.4.5

05 Dec 10:28
Compare
Choose a tag to compare

🎉 release: v2.4.4

14 Nov 03:31
Compare
Choose a tag to compare

🌟 Help us spread the word about Prisma ORM for Dart by starring the repo or tweeting about the release. 🌟

Engines

  • Update Prisma query engine to 694eea289a8462c80264df36757e4fdc129b1b32 (from 4.6.1)
  • Update Data Proxy remote prisma client to 4.6.1
  • Interactive Transactions for Prisma Data Proxy

Generator

  • Fix standard data type error calling fromJson