Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prisma monorepo to v2.27.0 (minor) #6096

Merged
merged 5 commits into from
Jul 13, 2021
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 13, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@prisma/client (source) 2.26.0 -> 2.27.0 age adoption passing confidence
@prisma/migrate (source) 2.26.0 -> 2.27.0 age adoption passing confidence
@prisma/sdk (source) 2.26.0 -> 2.27.0 age adoption passing confidence
prisma (source) 2.26.0 -> 2.27.0 age adoption passing confidence

Release Notes

prisma/prisma

v2.27.0

Compare Source

Today, we are excited to share the 2.27.0 stable release 🎉

🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release. 🌟 

Major improvements & new features
MongoDB is Now in Preview 🎉

We're thrilled to announce that Prisma now has Preview support for MongoDB. Here's how to get started:

Inside your schema.prisma file, you'll need to set the database provider to mongodb. You'll also need to add mongoDb to the previewFeatures property in the generator block:

// Set the database provider to "mongodb"
datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

// We want to generate a Prisma Client
// Since mongodb is a preview feature, we need to enable it.
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["mongoDb"]
}

// Create our Post model which will be mapped to a collection in the database.
// All posts have a required `title`, `slug` and `body` fields.
// The id attributes tell Prisma it's a primary key and to generate 
// object ids by default when inserting posts.
model Post {
  id    String @​id @​default(dbgenerated()) @​map("_id") @​db.ObjectId
  slug  String @​unique
  title String
  body  String
}

Next, you'll need to add a database connection string to your .env file. We recommend using MongoDB Atlas to spin up a MongoDB database for free. Set the DATABASE_URL to the connection string you got from MongoDB Atlas, it should be similar to the following string:

DATABASE_URL="mongodb+srv://admin:<password>@&#8203;cluster0.quvqo.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"

❗️ Don't forget to include the username and password you set while creating the database in the connection string, otherwise you won't be able to connect to it.

Then you can run npx prisma generate to generate a MongoDB-compatible Prisma Client. The Prisma Client API is the same for Mongo as it is for other supported relational databases (PostgreSQL, MySQL, SQLite and Microsoft SQL Server).

To test that everything works, you can run the following script:

import { PrismaClient } from "@&#8203;prisma/client"
const prisma = new PrismaClient()

async function main() {
  // Create the first post
  await prisma.post.create({
    data: {
      title: "Prisma <3 MongoDB",
      slug: "prisma-loves-mongodb",
      body: "This is my first post. Isn't MongoDB + Prisma awesome?!",
    },
  })
  // Log our posts showing nested structures
  console.dir(posts, { depth: Infinity })
}

main()
  .catch(console.error)
  .finally(() => prisma.$disconnect())

You should see a new post created and added to your database! You can use Prisma Studio to view the record you just added by running npx prisma studio.

This is just the tip of the iceberg. Learn more in our Getting Started Guide.

We would love to know your feedback! If you have any comments or run into any problems we're available in this issue. You can also browse existing issues that have the MongoDB label.

Prisma native support for M1 Macs 🚀

This one's for our Mac users. Prisma now runs natively on the new M1 chips. Best of all, there's nothing to configure, it just works. Enjoy the speed bump!

Fixes and improvements
Prisma Client
Prisma Migrate
📺 Join us for another "What's new in Prisma" livestream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.

The stream takes place on Youtube on Thursday, July 15 at 5pm Berlin | 8am San Francisco.


Configuration

📅 Schedule: "before 7am on Tuesday,before 7am on Wednesday" in timezone Australia/Sydney.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2021

🦋 Changeset detected

Latest commit: 9f15279

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@keystone-next/keystone Patch
@keystone-next/api-tests-legacy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 13, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/FH2uEbGS3jeQ7Ni8kMcGPeqwDBA8
✅ Preview: https://keystone-next-docs-git-renovate-prisma-monorepo-keystonejs.vercel.app

@vercel vercel bot temporarily deployed to Preview July 13, 2021 14:42 Inactive
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 13, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 7ab9354 to 5c9964e Compare July 13, 2021 22:40
@vercel vercel bot temporarily deployed to Preview July 13, 2021 22:40 Inactive
@vercel vercel bot temporarily deployed to Preview July 13, 2021 23:15 Inactive
@vercel vercel bot temporarily deployed to Preview July 13, 2021 23:19 Inactive
@vercel vercel bot temporarily deployed to Preview July 13, 2021 23:26 Inactive
Copy link
Contributor

@timleslie timleslie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@timleslie timleslie merged commit fbe6984 into master Jul 13, 2021
@timleslie timleslie deleted the renovate/prisma-monorepo branch July 13, 2021 23:32
Nikitoring pushed a commit to Nikitoring/keystone that referenced this pull request Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants