yoshi nakamura
05/13/2022, 4:39 PMZB
05/15/2022, 5:02 PMAlbin Groen
05/23/2022, 7:58 AM@updatedAt
modifier
2. Functionality for dragging and dropping model fields
3. Remove the possibility to use enums when using SQLite as your providerMatija Sosic
05/24/2022, 3:13 PMArnav Gosain
05/29/2022, 3:21 PMHarsh Singh
06/02/2022, 5:50 AMprisma-schema-splitter
which allows you to define multiple Prisma schemas to better organise your project. Let me know your thoughts on that!Harsh Singh
06/02/2022, 5:51 AMHarsh Singh
06/05/2022, 4:37 AMprisma-schema-splitter
which I talked about before, since Nikolas showed me some other tools which already solve the problem.
I've now begun working on another tool which (hopefully) nobody has made before. It's called prisma-tests-generator
and it generates tests for your database (for CRUD functions) using Mocha/Chai or Jest. I've actually been able to get quite far in a couple of hours. Right now, the CRUD functions work along with other boilerplate code to delete the tables created.
Before I publish, I need to:
โข Test this more extensively by using random schemas on GitHub
โข Add support for referential integrity and enums
...and for my roadmap, I was hoping to:
โข Add JavaScript support (right now tests are generated in TypeScript)
โข Add support for using other testing libraries such as Jest (currently tests are in only Mocha/chai)
โข Allow some more customisation as to where the user wishes the tests to be generated, the file names, test splitting, etc.
Anyways, I've had a fun time using Prisma's SDK to develop the library. The fact that it's there's nothing documented (https://github.com/prisma/prisma/discussions/10721#discussioncomment-1822836) makes it more interesting as I've definitely learned much more about the internals of Prisma and the SDK by going through the code several times.Nathan Froese
06/08/2022, 2:55 PMHarsh Singh
06/12/2022, 6:25 AMprisma-tests-generator
for those who are interested!
It now builds to an actual TypeScript file, and I've added support for enums that you might have defined in your schema! Several smaller bug fixes here and there too ๐
I'm hoping to add support for the FKC and then I'll be glad to ship out a beta/testing version of this package! I'll then work on enhancements such as JavaScript tests, or testing with other libraries such as Jest.
Attached is a video of the tool:Harsh Singh
06/12/2022, 6:25 AMAlbin Groen
06/12/2022, 5:21 PMsramam
06/13/2022, 8:21 AMKen Fukuyama
06/14/2022, 1:27 PMasync execute({ productIds }: CreateOrderInput) {
const order = Order.create(productIds);
// create a transaction scope inside the Application layer
await this.transactionScope.run(async () => {
// call multiple repository methods inside the transaction
// if either fails, the transaction will rollback
await this.orderRepo.create(order);
await this.notificationRepo.send(
`Successfully created order: ${order.id}`
);
});
}
Hereโs a blog post and also the PoC repository: https://github.com/kenfdev/prisma-auto-transaction-poc
Feedbacks are welcome!Harsh Singh
06/17/2022, 6:16 AMprisma-tests-generator
-- it now supports relations/foreign keys! After some extensive testing, I think it'll be ready to publish soon ๐Moin Akhter
06/18/2022, 11:52 AMHarsh Singh
06/22/2022, 6:54 AMprisma-tests-generator
library. Fixed some types errors, tested around with some other random schemas from GitHub, and setup the README for the project. I'm on road to publish this project in a approximately week or two fast parrot
Here's a the generator in live action now:Aaron Powell
06/28/2022, 6:44 AMMatija Sosic
06/30/2022, 2:23 PMAlex Ruheni
prisma migrate diff
or prisma db execute
commands? We are curious to learn how you are using these commands and look forward to your feedback in this GitHub discussion. ๐
We released prisma migrate diff
and prisma db execute
commands into General Availability in version 3.13.0
to enable our users to create and understand migrations and build custom workflows using these commands:
โข prisma migrate diff
command creates a diff of database schema, Prisma schema file, or the migration history by feeding it a from
state and a schema to
state to get an SQL script or a human-readable diff.
โข prisma db execute
is used to execute SQL scripts against the database.
Both commands create many possibilities for creating workflows with some automation tooling. Here are some of the workflows that the commands can unlock:
โข Fixing failed migrations
โข Squashing migrations
โข Generating down migrations
Feel free to also refer to the reference for the migrate diff
and db execute
commands.
Happy to answer your questions. ๐
Your friends at Prisma. ๐Aladin
07/07/2022, 2:19 AMDecimal
when Prisma supports Decimal again for MongoDB. So we built a good middleware (that's slowing down our queries currently), it converts from Number to Decimal when writing to DB and vice versa when fetching from DB.
2. We also developed a tool to convert Decimal
fields from the schema to Float
just before the generate
phase of prisma. This way, we keep our original schemas intact until Prisma releases Decimal support for MongoDB.
3. We use lots of internally developed modules and they're published to NPM. And because we're planning to open source some of our tech, these modules needed to be agnostic to Flux, so they had to embed their own Prisma schema. We built an internal module @driveflux/prisma-schema-merger
that's not open sourced yet. It combines schemas from different modules into one main schema file and allows adding/deleting/updating fields from models, types and enums and publishes one main prisma file.
So far, everything is great and we can't be more grateful to the prisma community for this awesome piece of work.Albin Groen
07/10/2022, 8:14 AMandrewicarlson
07/13/2022, 2:25 AMZB
07/15/2022, 10:39 AMFarhan Haider
07/16/2022, 9:28 PMIddan Aaronsohn
07/20/2022, 7:49 AMVasek Mlejnsky
07/29/2022, 4:05 PMFoysal
07/31/2022, 5:27 PMyujonglee
08/07/2022, 6:14 AMletsdmmf
a few days ago.
https://github.com/yujong-lee/letsdmmf
Anyone interested in building Prisma Generator might find it useful. If you are new to DMMF, you can run letsdmmf example
to learn about DMMF with a minimal schema of various types.
You can only install it via Homebrew for now.
Any questions/contributions are welcome. Thank you.James Fox
08/17/2022, 7:47 AM