# What's new in Prisma? (Q2/21) URL: https://www.prisma.io/blog/whats-new-in-prisma-q2-2021-z70muetl386d Published: 2021-07-08 Authors: Mahmoud Abdelwahab Tags: announcement Description: Learn about everything that has happened in the Prisma ecosystem and community from April to June 2021. > Blog posts describe Prisma as it was on the date shown and are not kept current. Before implementing from a post, check the documentation index at https://www.prisma.io/docs/llms.txt and the changelog at https://www.prisma.io/changelog.md. > For an index of every published post, fetch https://www.prisma.io/blog/llms.txt. Learn about everything that has happened in the Prisma ecosystem and community from April to June 2021. ## Overview [#overview] * [Releases & new features](#releases--new-features) * [Launched Prisma's online data browser in Early Access](#launched-prismas-online-data-browser-in-early-access) * [Referential Actions now enable cascading deletes and updates (Preview)](#referential-actions-now-enable-cascading-deletes-and-updates-preview) * [`prisma db push` is now generally available ๐Ÿš€](#prisma-db-push-is-now-generally-available-) * [Human-readable drift diagnostics for `prisma migrate dev`](#human-readable-drift-diagnostics-for-prisma-migrate-dev) * [New features for the Prisma Client API](#new-features-for-the-prisma-client-api) * [Support for .env files in Prisma Client Go](#support-for-env-files-in-prisma-client-go) * [MongoDB gets Json and Enum Support](#mongodb-gets-json-and-enum-support) * [JSON filtering (preview)](#json-filtering-preview) * [Order by an aggregate in groupBy (preview)](#order-by-an-aggregate-in-groupby-preview) * [Community](#community) * [Meetups](#meetups) * [Prisma Day 2021](#prisma-day-2021) * [Tweets for trees](#tweets-for-trees) * [Stickers](#stickers) * [Videos, livestreams & more](#videos-livestreams--more) * [What's new in Prisma](#whats-new-in-prisma) * [Videos](#videos) * [Written content](#written-content) * [Prisma appearances](#prisma-appearances) * [New Prismates](#new-prismates) * [What's next?](#whats-next) ## Releases & new features [#releases--new-features] Our engineers have been hard at work issuing new [releases](https://github.com/prisma/orm/releases/) with many improvements and new features every two weeks. Here is an overview of the most exciting features that we have launched in the last three months. You can stay up-to-date about all upcoming features on our [roadmap](https://pris.ly/roadmap). ### Launched Prisma's online data browser in Early Access [#launched-prismas-online-data-browser-in-early-access] Prisma's online data browser allows you to easily collaborate with your team on your data. You can: * Import your Prisma projects from GitHub. * Add other users to it, such as your teammates or your clients. * Assign users one of four roles: Admin, Developer, Collaborator, Viewer. * View and edit your data collaboratively online. > Note: The online data browser is released in Early Access. This means it is not production-ready and we are actively seeking feedback that helps us improve it. Please report any UX issues, bugs or other friction points that you encounter. You can try it today and we would love to [know your feedback](https://github.com/prisma/studio/issues/new?assignees=\&labels=topic%3A+hosted+data+browser\&template=hosted-data-browser-bug-report.md\&title=)!
[Try Prisma's Online Data Browser](https://cloud.prisma.io/login) ### Referential Actions now enable cascading deletes and updates (Preview) [#referential-actions-now-enable-cascading-deletes-and-updates-preview] Since [2.26.0](https://github.com/prisma/orm/releases/tag/2.26.0), we introduced a new feature in [Preview](https://www.prisma.io/docs/orm/v7/more/releases#preview) which allow you to define cascading delete and update behavior in your Prisma schema. Hereโ€™s an example: ```prisma model User { id String @id posts Post[] } model Post { id String @id authorId String author User @relation(fields: [authorId], onDelete: Cascade, onUpdate: Cascade) } ``` If you run into any questions or have any feedback, weโ€™re available in this [issue](https://github.com/prisma/orm/issues/7816). ### `prisma db push` is now generally available ๐Ÿš€ [#prisma-db-push-is-now-generally-available-] `prisma db push` enables you to update the database schema from the Prisma schema file, without generating any migrations. This is especially useful when prototyping a new feature, iterating on the schema changes before creating migrations or generally if you are at stage of your development process, where you don't need to persist the schema change history via database migrations. It is now promoted from [Preview](https://www.prisma.io/docs/orm/v7/more/releases#preview) to [General Availability](https://www.prisma.io/docs/orm/v7/more/releases#generally-available-ga). You can find more info on `prisma db push` in the [official docs](https://www.prisma.io/docs/orm/v7/prisma-migrate/workflows/prototyping-your-schema). ### Human-readable drift diagnostics for `prisma migrate dev` [#human-readable-drift-diagnostics-for-prisma-migrate-dev] Since [2.25.0](https://github.com/prisma/orm/releases/tag/2.25.0), Database schema drift occurs when your database schema is out of sync with your migration history, i.e. the database schema has drifted away from the source of truth. With this release, we improve the way how the drift is printed to the console when detected in the `prisma migrate dev` command. While this is thew only command that uses this notation in today's release, we plan to use it in other places where it would be useful for debugging in the future. ```shell [*] Changed the `Color` enum [+] Added variant `TRANSPARENT` [-] Removed variant `RED` [*] Changed the `Cat` table [-] Removed column `color` [+] Added column `vaccinated` [*] Changed the `Dog` table [-] Dropped the primary key on columns (id) [-] Removed column `name` [+] Added column `weight` [*] Altered column `isGoodDog` (arity changed from Nullable to Required, default changed from `None` to `Some(Value(Boolean(true)))`) [+] Added unique index on columns (weight) ``` ### New features for the Prisma Client API [#new-features-for-the-prisma-client-api] We regularly add new features to the Prisma Client API to enable more powerful database queries that were previously only possible via plain SQL and the `$queryRaw` escape hatch. #### Support for .env files in Prisma Client Go [#support-for-env-files-in-prisma-client-go] You can now use a .env file with Prisma Client Go. This makes it easier to keep database credentials outside your Prisma schema and potentially work with multiple clients at the same time: ``` example/ โ”œโ”€โ”€ .env โ”œโ”€โ”€ main.go โ””โ”€โ”€ schema.prisma ``` Learn more about using the .env file in our [documentation](https://www.prisma.io/docs/orm/v7/more/dev-environment/environment-variables#using-env-files). #### MongoDB gets Json and Enum Support [#mongodb-gets-json-and-enum-support] In [2.24.0](https://github.com/prisma/orm/releases/tag/2.24.0), we added `Json` and `enum` support to the MongoDB provider for Prisma Client. Here's a sample schema with both: ```prisma prisma datasource db { provider = "mongodb" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["mongodb"] } model Log { id String @id @default(dbgenerated()) @map("_id") message String level Level @default(Info) meta Json } enum Level { Info Warn Error } ``` As a reminder, the mongodb provider is still in [Early Access](https://www.prisma.io/docs/orm/v7/more/releases#early-access). If you'd like to use MongoDB with Prisma, please fill out this [2-minute Typeform](https://prisma-data.typeform.com/to/FriDuIeM) and we'll get you an invite to our Getting Started guide and private Slack channel right away! #### JSON filtering (preview) [#json-filtering-preview] Since [2.23.0](https://github.com/prisma/orm/releases/tag/2.23.0), you can now filter rows by data inside a Json type. JSON filtering support is available in PostgreSQL and MySQL. Assuming we have the following data in a database: | id | level | message | meta | | -- | ------- | ---------------------------------- | -------------------------------------------------------------- | | 2 | `INFO` | application listening on port 3000 | `{"host": "bob"}` | | 3 | `INFO` | upgrading account | `{"host": "alice", "request_id": 10}` | | 4 | `INFO` | charging customer | `{"host": "alice", "amount": 20, "request_id": 10}` | | 5 | `ERROR` | credit card expired | `{"host": "alice", "amount": 20, "request_id": 10}` | | 6 | `INFO` | signing up | `{"host": "bob", "request_id": 1}` | | 7 | `INFO` | application listening on port 3000 | `{"host": "alice"}` | | 8 | `INFO` | signed up | `{"host": "bob", "email": "james@gmail.com", "request_id": 1}` | We can now filter logs by the data inside the meta field. ```ts const logs = await prisma.log.findMany({ where: { meta: { // path looks for the request_id key inside meta path: ['request_id'], // and we select rows whose request_id is 10 equals: 10, }, }, orderBy: { id: 'asc', }, }) ``` ```prisma generator client { provider = "prisma-client-js" previewFeatures = ["filterJson"] } model Log { id Int @id @default(autoincrement()) level Level message String meta Json } enum Level { INFO WARN ERROR } ``` #### Order by an aggregate in groupBy (preview) [#order-by-an-aggregate-in-groupby-preview] Since [2.21.0](https://github.com/prisma/orm/releases/tag/2.21.0), you can Order by an aggregate in groupBy. Let's say you want to group your users by the city they live in and then order the results by the cities with the most users. ```ts const userRatingsCount = await prisma.user.groupBy({ by: ['city'], count: { city: true, }, orderBy: { _count: { city: 'desc', }, }, } ``` ```prisma model User { id Int @id @default(autoincrement()) email String @unique name String? city String } ``` The query returns the following data: ``` [ { city: 'Berlin', count: { city: 3 } }, { city: 'Paris', count: { city: 2 } }, { city: 'Amsterdam', count: { city: 1 } }, ] ``` ## Community [#community] We wouldn't be where we are today without our amazing [community](https://www.prisma.io/community) of developers. Our [Slack](https://slack.prisma.io) has more than 40k members and is a great place to ask questions, share feedback and initiate discussions all around Prisma.
[Join Slack](https://slack.prisma.io) ### Meetups [#meetups] - [Prisma Meetup #6](https://www.meetup.com/Berlin-Prisma-Meetup/events/278275834/) - [Connect Dev Africa Meetup #1](https://www.meetup.com/connect-dev-africa/events/278245682/) - [TypeScript Berlin Meetup #6](https://www.meetup.com/TypeScript-Berlin/events/278178824/) - [Prisma Meetup #5 + a raffle!](https://www.meetup.com/Berlin-Prisma-Meetup/events/277753565/) - [TypeScript Berlin/Sevilla Meetup](https://www.meetup.com/TypeScript-Berlin/events/277610945/) - [GraphQL Berlin Meetup #22](https://www.meetup.com/graphql-berlin/events/277280108/) - [Prisma Meetup #4](https://www.meetup.com/Berlin-Prisma-Meetup/events/277236269/) ### Prisma Day 2021 [#prisma-day-2021] [Prisma Day](https://www.prisma.io/day) has been a huge success and we want to thank everyone who attended and helped making it a great experience! It was a two day event of talks and workshops by members of the Prisma community. This was our **3rd** Prisma day which had **15** amazing talks and an introduction to Prisma workshop offered in **11** different languages. We've been excited to see fantastic speakers, educators sharing their knowledge and what they're working on. We would also love to thank the amazing workshop hosts for delivering exceptional workshops. The event covered a broad range of topics: * Modern Application Development: from type safety and TypeScript, or GraphQL, or JAMStack and the latest Javascript Frameworks, get an overview of the evolving tool landscape that reshapes how applications are architected, built, and deployed. * Database best practices: a deeper dive into considerations when building stateful applications. Discover the key considerations that give you further control over getting the most out of your data. * Prisma in Production: discover how users implement Prisma in the their critical applications and what Prisma has in store in the future. If you missed the event, you can watch all the talks on our [YouTube channel](https://youtube.com/playlist?list=PLn2e1F9Rfr6mjeYBSsSZoHFVjMq0nCtfL). ### Tweets for trees [#tweets-for-trees] To celebrate [Earth Day](https://erthday.org) ๐ŸŒ, we started the [Tweets for trees](https://www.prisma.io/blog/tweets-for-trees-arboreal) initiative. This was an initiative where we planted a tree for every tweet about Prisma during the month of April. We planted a total of **269 trees ๐ŸŒณ** for our [Prisma forrest](https://tree-nation.com/profile/impact/prisma-data-services-gmbh). ## Stickers [#stickers] We love seeing laptops that are decorated with Prisma stickers, so we're shipping sticker packs for free to our community members! In this quarter, we've sent out over 300 sticker packs to developers that are excited about Prisma!
[Order Stickers](https://gist.github.com/nikolasburk/5b64014d41bc21594808cea82621df83) *** ## Videos, livestreams & more [#videos-livestreams--more] ### What's new in Prisma [#whats-new-in-prisma] Every other Thursday, [Nikolas Burk](https://twitter.com/nikolasburk) and [Ryan Chenkie](https://twitter.com/ryanchenkie) discuss the latest Prisma release and other news from the Prisma ecosystem and community. If you want to travel back in time and learn about a past release, you can find all the shows from this quarter here: [Watch the video on YouTube](https://www.youtube.com/watch?v=i8TqB5ofVaM) * [2.25.0](https://www.youtube.com/watch?v=Fkj3Zaow5fQ\&list=PLn2e1F9Rfr6l1B9RP0A9NdX7i7QIWfBa7\&index=1) * [2.24.0](https://www.youtube.com/watch?v=nTI4jjsyoEg\&list=PLn2e1F9Rfr6l1B9RP0A9NdX7i7QIWfBa7\&index=2) * [2.23.0](https://www.youtube.com/watch?v=lwl0IOj2PxM\&list=PLn2e1F9Rfr6l1B9RP0A9NdX7i7QIWfBa7\&index=3) * [2.22.0](https://www.youtube.com/watch?v=zBIQUdqgfJM\&list=PLn2e1F9Rfr6l1B9RP0A9NdX7i7QIWfBa7\&index=4) * [2.21.0](https://www.youtube.com/watch?v=kGBBS0MvNC0\&list=PLn2e1F9Rfr6l1B9RP0A9NdX7i7QIWfBa7\&index=5) ### Videos [#videos] #### How To Choose a Database for your App [#how-to-choose-a-database-for-your-app] [Watch the video on YouTube](https://www.youtube.com/watch?v=xGCm_cLxets) #### A Practical Introduction to Prisma (Workshop | April 2021) [#a-practical-introduction-to-prisma-workshop--april-2021] [Watch the video on YouTube](https://www.youtube.com/watch?v=tdiB-DjAnUk) #### Announcing Early Access for Prisma's Online Data Browser [#announcing-early-access-for-prismas-online-data-browser] [Watch the video on YouTube](https://www.youtube.com/watch?v=VRzuTofSooo) #### What is Prisma? [#what-is-prisma] [Watch the video on YouTube](https://www.youtube.com/watch?v=EEDGwLB55bI) This bring us to a total of 6 livestreams and 5 new videos ๐ŸŽ‰. You can check them out on our [YouTube channel](https://youtube.com/prismadata) ### Written content [#written-content] During this quarter, we published several technical articles that you might find useful: * [Set up a free PostgreSQL database on Supabase to use with Prisma](https://dev.to/prisma/set-up-a-free-postgresql-database-on-supabase-to-use-with-prisma-3pk6) * [5 Tools for Documenting Your Web API](https://www.prisma.io/blog/documenting-apis-mjjpZ7E7NkVP) * [Application Monitoring Best Practices](https://www.prisma.io/blog/monitoring-best-practices-monitor5g08d0b) * [Syncing Development Databases Between Team Members](https://www.prisma.io/dataguide/managing-databases/syncing-development-databases-between-team-members) * [Setting up a local MongoDB database](https://www.prisma.io/dataguide/mongodb/setting-up-a-local-mongodb-database) * [Connecting to MongoDB databases](https://www.prisma.io/dataguide/mongodb/connecting-to-mongodb) * [How to manage users and authentication in MongoDB](https://www.prisma.io/dataguide/mongodb/configuring-mongodb-user-accounts-and-authentication) * [How to Spot Bottlenecks in Performance](https://www.prisma.io/dataguide/managing-databases/how-to-spot-bottlenecks-in-performance) * [Strategies for deploying database migrations](https://www.prisma.io/dataguide/types/relational/migration-strategies) * [Troubleshooting Database Outages and Connection Issues](https://www.prisma.io/dataguide/managing-databases/database-troubleshooting) * [Setting up a local SQL Server database for Microst SQL Server](https://www.prisma.io/dataguide/mssql/setting-up-a-local-sql-server-database) * [Using the expand and contract pattern for schema changes](https://www.prisma.io/dataguide/types/relational/expand-and-contract-pattern) We also published multiple success stories of companies adopting Prisma: * [How Poppy Uses Prisma Client to Ship Confidently](https://www.prisma.io/blog/poppy-customer-success-story-swnWQcGRRvpd) * [How Grover Moves Faster with Prisma](https://www.prisma.io/blog/grover-customer-success-story-nxkWGcGNuvFd) * [How iopool refactored their app in less than 6 months with Prisma](https://www.prisma.io/blog/iopool-customer-success-story-uLsCWvaqzXoa) ### Prisma appearances [#prisma-appearances] This quarter, several Prisma folks have appeared on external channels and livestreams. Here's an overview of all of them: * [Ryan Chenkie @ Digital Ocean livestream with Chris Sev](https://www.youtube.com/watch?v=mjRs6qAdGfM) * [Mahmoud Abdelwahab @ Orbit's Communitree with Rosie Sherry](https://racket.com/rosiesherry/rRYf7) * [Mahmoud Abdelwahab @ James Q Quick's livestream](https://www.youtube.com/watch?v=1tLr_NnUq9I) * [Nikolas Burk @ the Learn with Jason livestream](https://www.youtube.com/watch?v=hMWMPpy4ta4) *** ## New Prismates [#new-prismates] Here are the awesome new Prismates who joined Prisma this quarter:
- **Pierre-Antoine Mills**, TypeScript Engineer - **Jacob Drabczyk**, Software Engineer - **Frank PrรถรŸdorf**, Software Engineer - **Sarah Vang Nรธer**, Engineering Manager Also, **we are hiring** for various roles! If you're interested in joining us and becoming a Prismate, check out our [jobs page](https://www.prisma.io/company/careers).
[Explore Jobs](https://www.prisma.io/company/careers) ## What's next? [#whats-next] The best places to stay up-to-date about what we are currently working on are [GitHub issues](https://github.com/prisma/orm/issues) and our public [roadmap](https://pris.ly/roadmap). (Mongo DB support coming soon ๐Ÿ‘€) You can also engage in conversations in our [Slack channel](https://slack.prisma.io), start a discussion on [GitHub](https://github.com/prisma/orm/discussions) or join one of the many [Prisma meetups](https://www.prisma.io/community) around the world.