Prisma Client Dart is an auto-generated type-safe ORM. It uses Prisma Engine as the data access layer and is as consistent as possible with the Prisma Client JS/TS APIs.
BSD-3-CLAUSE License
Bot releases are hidden (Show)
Published by medz 9 months ago
To install Prisma Dart client v3.4.7, run the following command:
dart pub add orm:3.4.7
To update Prisma Dart client v3.4.7, update the orm
dependency in your pubspec.yaml
file.
dependencies:
orm: ^3.4.7
pwd
.Published by medz 9 months ago
To install Prisma Client Dart v4.0.0-beta.1 run:
dart pub add orm:4.0.0-beta.1
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-beta.1
@kidusdev
Published by medz 9 months ago
To install Prisma Client Dart v4.0.0-beta run:
dart pub add orm:4.0.0-beta
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-beta
The first Beta version is released. This version is a major version. We will conduct a lot of testing on this version to ensure the stability of this version.
In addition, there are no actual code updates in this version, the documentation brings updates to the API Reference:
Published by medz 9 months ago
To install Prisma Dart client v4.0.0-alpha.5 run:
dart pub add orm:4.0.0-alpha.5
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-alpha.5
Published by medz 9 months ago
To install Prisma Dart client v4.0.0-alpha.4 run:
dart pub add orm:4.0.0-alpha.4
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-alpha.4
Published by medz 9 months ago
To install Prisma Dart client v4.0.0-alpha.3 run:
dart pub add orm:4.0.0-alpha.3
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-alpha.3
webfetch
to 0.0.14
version._
) in schema.prisma
causing the generator to fail. - #317 #316Published by medz 10 months ago
To install Prisma Dart client v4.0.0-alpha.2 run:
dart pub add orm:4.0.0-alpha.2
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-alpha.2
^3.2.0
You can use $raw
to execute raw queries
$raw.query
Execute a raw query, for example:
final result = await prisma.$raw.query('SELECT * FROM "User"'); // PostgreSQL
$raw.execute
Execute a raw query, for example:
final result = await prisma.$raw.execute('DELETE FROM "User"'); // PostgreSQL
$raw.query
and $raw.execute
support parameters, for example:
// PostgreSQL
final result = await prisma.$raw.query(
'SELECT * FROM "User" WHERE "id" = \$1',
[1],
);
// MySQL
final result = await prisma.$raw.query(
'SELECT * FROM `User` WHERE `id` = ?',
[1],
);
SQL template string see your used database.
Published by medz 10 months ago
To install Prisma Dart client v3.4.6, run the following command:
dart pub add orm
To update Prisma Dart client v3.4.6, update the orm
dependency in your pubspec.yaml
file.
dependencies:
orm: ^3.4.6
prisma-query-engine
.dart_tool
directory to the search directoryprisma-query-engine
errorCannot find the query engine binary (Basename: C:\path\does\not\matter\query-engine-windows.exe | prisma-query-engine)
If you just run your app using the dart run {script}.dart command, you donβt need to do anything.
If you use dart compile exe to package your app as a executable, copy prisma-query-engine to the same location as your run file
Published by medz 10 months ago
To install Prisma Dart client v4.0.0-alpha.1 run:
dart pub add orm:4.0.0-alpha.1
Or update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-alpha.1
PrismaClient
is now generated by the generatorPublished by medz 11 months ago
To install Prisma Dart client v3.4.5, run the following command:
dart pub add orm
To update Prisma Dart client v3.4.5, update the orm
dependency in your pubspec.yaml
file.
dependencies:
orm: ^3.4.5
Published by medz 11 months ago
To install Prisma Dart client v4.0.0-alpha.0 run:
# If you are using Dart
dart pub add orm:4.0.0-alpha.0
# Or if you are using Flutter
flutter pub add orm:4.0.0-alpha.0
To upgrade to Prisma Dart client v4.0.0-alpha.0, Please follow the announcements and update your pubspec.yaml
file:
dependencies:
orm: 4.0.0-alpha.0
Read Prisma Dart Client v4.0.0-alpha.0 release notes on the Prisma Dart discussions
select
feature (incomplete, currently only support rough one-level Model fields)include
feature (incomplete, currently only support rough one-level Model fields)PrismaUnion
regression, now can structure nested inputs of multiple parameters via unionPrismaNull
regression, now support database null
data settingorm
as the base package for developing Dart Prisma ecosystem packagesDecimal
type support (from decimal package, exported by orm
proxy)Published by medz over 1 year ago
π Help us spread the word about Prisma ORM for Dart by starring the repo or tweeting about the release. π
Note: Migration from 2.x to 3.x guide is available here.
Published by medz almost 2 years ago
DateTime
to String
must be ISO8601 format error - #103
PrismaNull
being serialized as null
error.Published by medz almost 2 years ago
createPrismaClient
Published by medz almost 2 years ago
π Help us spread the word about Prisma ORM for Dart by starring the repo or tweeting about the release. π
Breaking change: You are now asked to install the freezed
package:
dart pub add freezed -d
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
andwithUserUncheckedCreateInput
are generated byprisma_client.dart
file.
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: '[email protected]',
),
),
);
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.
Published by medz almost 2 years ago
OrThrow
methodsPrisma client now supports OrThrow
methods.
final User user = await prisma.user.findUniqueOrThrow(...);
final Post post = await prisma.post.findFirstOrThrow(...);