-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Seven Du
committed
Oct 8, 2022
1 parent
62142bd
commit 21e3c33
Showing
4 changed files
with
39 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,3 @@ | ||
## {next} | ||
|
||
🌟 Help us spread the word about [Prisma ORM for Dart](https://github.com/odroe/prisma-dart) by starring the repo or [Tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20ORM%20for%20Dart%20release%20v{next}🚀%0D%0A%0D%0Ahttps://github.com/odroe/prisma-dart/releases/tag/{next}) about the release. 🌟 | ||
|
||
### Features | ||
|
||
#### Logging (Preview) | ||
|
||
Prisma ORM for Dart now supports [logging](https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/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: | ||
|
||
```bash | ||
prisma generate --preview=logging | ||
``` | ||
|
||
```dart | ||
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. | ||
|
||
```dart | ||
prisma.$on([PrismaLogLevel.query], (e) { | ||
print(e); | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21e3c33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
prisma-dart – ./
prisma-dart-git-main-odroe.vercel.app
prisma-dart.vercel.app
www.prisma.pub
prisma.pub
prisma-dart-odroe.vercel.app