Skip to content

Releases: medz/prisma-dart

2.4.2

26 Oct 06:03
Compare
Choose a tag to compare
  • Fix init command generated SQLite database file url

2.4.1

26 Oct 06:02
Compare
Choose a tag to compare
  • Fix JSON-RPC error code on error data is nullable - #52

🎉 release: v2.4.0

20 Oct 06:19
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. 🌟

Major improvements

Refactor Prisma config (environment), starting from 2.4.0, Prisma ORM for Dart no longer includes any third-party configurator.

What about the rc package?

The rc package was born for the Prisma ORM for Dart itself, and now the rc package has been refactored into a platform variable wrapper.

Production environment

The .prismarc file in the Dart project directory was loaded by default, and now lib/prisma_configurator.dart is loaded by default.

Previously configured Key in pubspec.yaml was prismarc, now it is production.

Before:

prisma:
    prismarc: {path}

after:

prisma:
    production: {path}

Development environment

The .dev.rc file was loaded by default, now it is prisma/development.dart.

Platform Environment

Prisma adaptively loads platform environment variables according to the current platform environment.

This means that the environment variables in the current system can be read in Dart VM, Flutter JIT, Dart JIT-compiled and Dart AOT-compiled. And it cannot be read in Dart Web and Flutter built app.

Flutter built app is an exception, even though it supports dart:io but there is no environment variable for the build environment in it.

🎉 release: v2.3.1

08 Oct 09:33
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. 🌟

Features

Logging (Preview)

Prisma ORM for Dart now supports logging as a preview feature. That means, it might have some flaws, but we hope you'll try it out and provide feedback.

To enable logging, you need to set the log property on the PrismaClient constructor and generate command:

prisma generate --preview=logging
PrismaClient(
  log: [
    PrismaLogDefinition(
      level: PrismaLogLevel.query,
      emit: PrismaLogEvent.stdout,
    ),
  ],
)
Subscribe to log events

You can subscribe to log events to perform custom actions when a log occurs.

prisma.$on([PrismaLogLevel.query], (e) {
  print(e);
});

🎉 release: v2.3.0

29 Sep 09:48
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. 🌟

Features

Development runtime configuration.

When using Prisma ORM to develop an app, you may want the development configuration to be inconsistent with the production environment (although this can be avoided by configuring the production environment separately), but there are always surprises.

For example, when we use Data Proxy, the client and CLI cannot be consistent, because the link address of Data Proxy cannot manage your database.

Now, you just need to add a .dev.rc to the root of your Dart project whose configuration will override the same configuration for prismarc and dotenv:

# .prismarc
DATABASE_URL: prisma://{location}.prisma-data.com/?api_key={Your API key}

# .dev.rc
DATABASE_URL: postgres://user:password@localhost:5432/mydb

For example in the configuration above, the actual CLI runtime uses postgres://user:password@localhost:5432/mydb, while in Prisma Client it uses prisma://{location}.prisma-data.com/?api_key={Your API key}.

Custom development runtime configuration

To customize the development runtime configuration file path, you can write in pubspec.yaml:

prisma:
  development: custom.devrc

Data Proxy (Preview)

Great, Prisma Dart now supports Prisma Data Proxy to access your database!

you just need to run:

dart run orm generate --data-proxy --preview=data-proxy

It can also be turned on from runtime configuration or dotenv:

# Configuration file
PRISMA_GENERATE_DATAPROXY = true

# Command line
dart run orm generate --preview=data-proxy
Custom remote client version.

If the default remote client version is not what you want, you can fix it by configuring:

PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION = "4.3.1"

Finalizer for PrismaClient

The PrismaClient now has a finalizer that will close the underlying database connection when the client is garbage collected.

Note: This feature is currently in preview state, you need to install 2.3.0 and above, and pass the --preview=finalizer option in the generate command to enable it. More information can be found in the 2.3.0@CLI change log.

CLI

generate command now supports --preview option to generate client for preview features.

E.g.

# Enable finalizer feature for generated PrismaClient.
dart run orm generate --preview=finalizer

Fixed bugs

2.3.0-beta.1

24 Sep 17:02
Compare
Choose a tag to compare
2.3.0-beta.1 Pre-release
Pre-release

Features

Development runtime configuration.

When using Prisma ORM to develop an app, you may want the development configuration to be inconsistent with the production environment (although this can be avoided by configuring the production environment separately), but there are always surprises.

For example, when we use Data Proxy, the client and CLI cannot be consistent, because the link address of Data Proxy cannot manage your database.

Now, you just need to add a .dev.rc to the root of your Dart project whose configuration will override the same configuration for prismarc and dotenv:

# .prismarc
DATABASE_URL: prisma://{location}.prisma-data.com/?api_key={Your API key}

# .dev.rc
DATABASE_URL: postgres://user:password@localhost:5432/mydb

For example in the configuration above, the actual CLI runtime uses postgres://user:password@localhost:5432/mydb, while in Prisma Client it uses prisma://{location}.prisma-data.com/?api_key ={Your API key}`.

Custom development runtime configuration

To customize the development runtime configuration file path, you can write in pubspec.yaml:

prisma:
  development: custom.devrc

Data Proxy

Great, Prisma Dart now supports Prisma Data Proxy to access your database!

you just need to run:

dart run orm generate --data-proxy

It can also be turned on from runtime configuration or dotenv:

PRISMA_GENERATE_DATAPROXY = true
Custom remote client version.

If the default remote client version is not what you want, you can fix it by configuring:

PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION = "4.3.1"

2.2.3

23 Sep 09:18
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. 🌟

Bug Fixes

  1. Fixed debian/ubuntu system distro match - #31
  2. Runtime - Fixed parse user facing error
  3. CLI - Fixed check engine version binary incomplete

🎉 2.2.2

22 Sep 06:53
Compare
Choose a tag to compare

Fixed generate schema not working (#29

🎉 v2.2.1 released

20 Sep 10:54
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. 🌟

Major improvements

Auto fix enum name and model name conflicts:

enum role {
 user
 admin
}

model user {
 id Int @id @default(autoincrement())
 role role
}

Before this release, the above schema would result in a role enum and a user model. This is not valid in Dart, so we now auto fix the enum name to Role and the model name to User.

Thanks to @moepoi

Bug fixes

  1. Fixed $transaction options not being passed.
  2. FIxed Using lowercase keywords in schema.prisma cannot generate clients correctly. - #26

Other

  • Update code_builder to ^4.3.0.

🎉 v2.2.0 released

20 Sep 07:01
1d0abc3
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. 🌟

Major improvements:

Input object Types without PrismaUnion wrapper, Before:

final User user = await prisma.user.create(
   data: PrismaUnion(
      zero: UserCreateInput(name: 'odroe'),
   ),
);

After:

final User user = await prisma.user.create(
   data: UserCreateInput(name: 'odroe'),
);

Bug fixes:

  • Nullable fields generating broken field implementations - #23

Features:

  • Add precache command, Populate the Prisma engines cache of binary artifacts.