Hey <!everyone> :v: :prisma-cool: We just release...
# prisma-whats-new
n
Hey <!everyone> ✌️ prisma cool We just released Prisma v2.11.0 with lots of exciting improvements! prisma rainbow 🧨 Native database types in the Prisma schema (Preview) With today's release, your Prisma schema becomes a lot more powerful as it can now represent native database types. Here's a short sneak peak for what this looks like in practice:
Copy code
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["nativeTypes"]
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model User {
  id    Int     @id @default(autoincrement()) 
  name  String? @db.VarChar(255)
}

model Post {
  id        Int      @id @default(autoincrement()) 
  title     String   @db.VarChar(100)
  createdAt DateTime @db.Timestamp(6)
  wordCount Int      @db.SmallInt
}
You can enable native types in your Prisma schema using the 
nativeTypes
 feature flag. 🆕 New scalar types in the Prisma schema: 
BigInt
Bytes
 and 
Decimal
 (Preview)
We're also adding new scalar types to the Prisma schema! From today on, you can use  
BigInt
Bytes
 and 
Decimal
. Check out the release notes to see how these are mapped to your database and to JavaScript/TypeScript when querying with Prisma Client JS. You can enable those with the 
nativeTypes
 feature flag in your Prisma schema as well. 🏸 Set foreign keys directly (Preview) This new Preview feature has been long requested and we're excited to make it finally happen. It'll make your code less verbose when you're working with relations. You now don't need to use a nested write with 
connect
 or 
disconnect
 any more to "rewire" a relation of two records, but instead you can just "set the foreign key" directly:
Copy code
await prisma.post.create({
  data: {
    // You can now set the foreign key directly...
    authorId: 1,
    // ... or connect the relationship...
    // author: {
    //   connect: {
    //     id: 1
    //   }
    // }
    // ... but not both at the same time
  },
});
You can enable those with the 
uncheckedScalarInputs
 feature flag in your Prisma schema as well. 🍾 More exiting features Thanks to your feedback, we were able to promote the 
$transaction
 and 
connectOrCreate
 APIs from Preview to this stable release! 🎉 This means you don't need to include the respective feature flag in your Prisma schema any more to use them. If you're curious about the remaining improvements in this release, be sure to check out the release notes. 🤩 Prisma Migrate is in Early Access We're making great progress with Prisma Migrate and were able to open up an Early Access program. You can learn everything you need to know in order to try out Prisma Migrate here. If you're just curious about the new workflows, check out this quick 

demo video

 recorded from our VP of Product @Hervé - Product at Prisma. Share your thoughts about the new version of Prisma Migrate in the #product-feedback channel 🙌 🌟 Help us spread the word about Prisma 🌟 To help spread the word about Prisma, we’d very much appreciate if you would star the repo 🌟 And if you’re excited about the features in this week’s release, then help us and share your excitement on Twitter. 📰 Join our What's new in Prisma livestream on Thursday Catch @ryan and me on Youtube as we are are discussing the latest news from the Prisma ecosystem and community in the next

 What's new in Prisma livestream

🎉 👀 Make your online talk recordings more accessible with subtitles We'd love to help you make your talk recordings (no matter if Meetup or conference talk) more accessible by adding subtitles to it for free! Reach out to sponsorships@prisma.io if you are interested in getting subtitles for your videos!
👏 25
🇫🇮 7
🏳️‍🌈 7
💚 8
📣 6
prisma rainbow 19
🤩 2
🇵🇱 9
💩 4
🎉 22
❤️ 12
🔥 13
💪 8
🚀 9
🚢 4
😘 1
prisma green 39
👀 26
💯 26
😎 9
graphql 7
🙏 6
prisma cool 13
🛳️ 3
🇭🇷 1
🇦🇷 2
🙌 1
🇩🇿 2
fast parrot 32
🇫🇷 4
🇳🇬 4
🇨🇳 1
🎌 1
🇳🇴 1
🇵🇸 1
🇲🇦 1
🇻🇳 1
newzealand parrot 2
🇨🇦 3
🇮🇳 4
🇵🇰 1
🇮🇱 1
🇯🇲 1
🇰🇷 7
🇵🇾 1
🇨🇿 1
🇺🇾 1
🇰🇪 1
🇸🇰 1
🇯🇵 1