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

chore(deps): update prisma monorepo to v2.8.0 #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 1, 2020

This PR contains the following updates:

Package Type Update Change
@prisma/cli (source) devDependencies minor 2.3.0 -> 2.8.0
@prisma/client dependencies minor 2.3.0 -> 2.8.0

Release Notes

prisma/prisma

v2.8.0

Compare Source

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

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

Major improvements

In today's release, we have two new features coming for you!

findFirst

While the findMany API gives you a powerful API to query your database with different filters, it's not ideal if you just want to query a single item.

On the other hand, the findOne API returns single items, but it only allows for filtering by unique fields.

In version 2.8.0, we introduce findFirst - giving you the full power of findMany filters while only returning the first item that matches the filter criteria.

So instead of this:

const usersCalledAlice = await prisma.user.findMany({
  name: "Alice"	
})
const firstUserCalledAlice = usersCalledAlice[0]

You can now do this:

const firstUserCalledAlice = await prisma.user.findFirst({
  name: "Alice"	
})

All filters available for findMany are also available in findFirst.

Case insensitive filters for PostgreSQL are now stable

In 2.5.0 we introduced case insensitive filters for PostgreSQL, in today's release we're promoting this feature to stable. This means you don't need to include the insensitiveFilters feature flag in the Prisma Client generator any more:

generator client {
  provider        = "prisma-client-js"
- previewFeatures = ["insensitiveFilters"]
}

The new mode option you can pass to findMany influences the corresponding filter (e.g. contains or startsWith) but doesn't change the return type of the findMany query. mode can have two possible values:

  • default: Uses the default filter configured on the database level. If the collation is configured as case insensitive in the database, the default mode will be case insensitive as well. In that case, there's no need to use the insensitive mode.
  • insensitive: Uses the case insensitive filter (if possible).
const result = await prisma.user.findMany({
  where: {
    email: {
      equals: 'lowercase@UPPERCASE.com',
      mode: 'insensitive',
    },
  },
})

Note that this feature will not work if you're using database collations that do not know how to convert between upper- and lowercase letters (e.g. the C collation).

📚 Documentation: Case sensitivity / Case-sensitive filtering

Already existing preview features from previous releases

Just a quick reminder:

  • In version 2.6.0 we introduced one preview feature, namely atomicNumberOperations.
  • In version 2.1.0 we introduced two preview features, namely connectOrCreate and transactionApi.

In case they're useful for you, please give them a try and share your feedback! These features remain in preview in this release.

Fixes and improvements

prisma
prisma-client-js
language-tools
studio
prisma-engines

❓ Are you using Prisma at work?

We'd love to know if you're using Prisma at work. Answer with a quick yes or no in our poll, it won't take longer than a few seconds!

Credits

Huge thanks to @​nohns for some great contributions in this release!

v2.7.1

Compare Source

Today, we are issuing the 2.7.1 patch release.

Fixes

Prisma Client JS
Prisma Studio

v2.7.0

Compare Source

Today we are excited to share the 2.7.0 stable release.

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

Major improvements

Prisma Studio is stable 🎉

We are more than excited to share that Prisma Studio has moved out of its experimental state and is promoted to stable with today's release! Prisma Studio is the perfect companion for developers who work with databases in their daily workflows, to quickly get an overview of the state of their database as well as to view and modify the data in it. An announcement blog post will be coming soon!

To use Prisma Studio in your Prisma project, you can now run the prisma studio command without the previously required --experimental flag:

npx prisma studio

Join the #prisma-studio channel in the Prisma Slack and let us know how you like Prisma Studio! 🙌

Configure Prisma schema location via package.json for more flexibility

Previously, your schema.prisma file needed to be available at a specific location when running Prisma CLI commands or provided via the --schema option when invoking a Prisma CLI command.

With this release, you can configure the location of your Prisma schema via a prisma property in your package.json:

{
  "prisma": {
    "schema": "path/to/schema.prisma"
  }
}

The provided location in package.json will be the default location of the Prisma schema file for any Prisma CLI command you invoke. Note that you can still override this default location by manually specifying the --schema option when invoking a Prisma CLI command.

📚 Documentation: Prisma schema file location

Already existing preview features from previous releases

Just a quick reminder:

  • In version 2.6.0 we introduced one preview feature, namely atomicNumberOperations.
  • In version 2.5.0 we introduced one preview feature, namely insensitiveFilters.
  • In version 2.1.0 we introduced two preview features, namely connectOrCreate and transactionApi.

In case they're useful for you, please give them a try and share your feedback! These features remain in preview in this release.

Feedback wanted: How does introspection work for you?

In the last few releases we improved Prisma's database introspection, most notably with "More robust introspection by keeping manual changes in the Prisma schema file" but also many smaller bug fixes. We think it is pretty stable now, and would love to hear from you, our users, how you have been using prisma introspect recently!

If you have used introspection in the past, whether it worked well or not so well with your database, please let us know by sharing your feedback on GitHub!

🌟 Help us spread the word about Prisma

To help spread the word about Prisma, we'd very much appreciate if you would star this repo 🌟 And if you're excited about the features in this week's release, then help us and share it on Twitter.

Fixes and improvements

prisma
prisma-client-js
migrate
language-tools
studio
prisma-engines

Credits

Huge thanks to @​bre7, @​rahul3v, @​jasonkuhrt and @​Weakky for helping!

v2.6.2

Compare Source

Today, we are issuing the 2.6.2 patch release.

Fixes

Prisma Client JS

v2.6.1

Compare Source

Today, we are issuing the 2.6.1 patch release.

Fixes

Prisma Client JS

v2.6.0

Compare Source

Today we are excited to share the 2.6.0 stable release.

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

Major improvements

More robust introspection by keeping manual changes in the Prisma schema file

In prior releases, any manual changes to your Prisma schema would be overridden when invoking prisma introspect (e.g. usage of @map or @@​map as well as the renaming of relation fields).

Keeping these manual changes in the Prisma schema file has been available as a preview feature via the --experimental-reintrospection already. After getting tested as a preview feature for a few releases, we are excited to promote this functionality to be the default behavior of prisma introspect into this stable release.

Note that you can opt-out of this behavior by using the new --force flag: prisma introspect --force. This will generate a schema purely based on the introspected database and override any prior manual changes.

📚 Documentation: Prisma Introspect

Preview features

New: Atomic number operations on update

With today's release, we introduce atomic number operations for update queries in Prisma Client. It allows you to update the values of certain fields atomically.

Feature flag

Atomic number operations needs to be enabled with the feature flag atomicNumberOperations like so:

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["atomicNumberOperations"]
}
Usage

We are introducing five atomic operations for Int and Float fields :

  • increment: x: Adds x to the current value
  • decrement: x: Subtracts x from the current value
  • multiply: x: Multiplies the current value by x
  • divide: x: Divides the current value by x
  • set: x: Sets the value to x (equivalent to data: { age: 18 })

Note: Only one operation can be done per field at a time.

Here's an example of using the new operations:

const result = await prisma.user.update({
  where: {
    email: 'hello@world.com',
  },
  data: {
    points: {
      set: 99, // this just sets the value, equivalent to `data: { points: 18 }`
    },
    age: {
      increment: 1, // age = age + 1 - Happy Birthday!
    },
    credits: {
     decrement: 2, // credits = credits - 2
    },
    karma: {
      multiply: 3, // karma = karma * 3
    },
    chocolates: {
      divide: 4, // chocolates = chocolates / 4
    },
  },
})

📚 Documentation: Atomic operations on update

Please share your feedback on how this feature works for you. We are interested in both positive and negative feedback, so we know if this feature is already ready for production! (If encounter any problems, please open a new issue here).

Already existing preview features from previous releases

Just a quick reminder:

  • In version 2.5.0 we introduced one preview feature, namely insensitiveFilters.
  • In version 2.1.0 we introduced two preview features, namely connectOrCreate and transactionApi.

In case they're useful for you, please give them a try and share your feedback! These features remain in preview in this release.

🤔 How would you describe Prisma?

We'd love to hear from you how you describe Prisma to your developer friends and coworkers. If you have 2 minutes, please answer this question via this online form.

🌟 Help us spread the word about Prisma

To help spread the word about Prisma, we'd very much appreciate if you would star this repo 🌟 And if you're excited about the features in this week's release, then help us and share it on Twitter.

Fixes and improvements

prisma
prisma-client-js
migrate
language-tools
studio
prisma-engines

Credits

Huge thanks to @​peter50216 for helping!

v2.5.1

Compare Source

Today, we are issuing the 2.5.1 patch release.

Fixes
Prisma Client JS
Studio
  • Bug fixes

v2.5.0

Compare Source

Today we are excited to share the 2.5.0 stable release.

🌟 Help us spread the word about Prisma by starring the repo ☝️, tweeting about the release or sharing your experience with Prisma on Reddit. 🌟

Major improvements
Middlewares, removing duplicates with distinct and aggregations are now stable

After running in preview mode for a number of releases, we are excited to promote the following features into this stable release:

  • middlewares
  • distinct
  • aggregationsApi

This means you can omit the respective feature flags in the generator block in your Prisma schema:

generator client {
  provider        = "prisma-client-js"
- previewFeatures = ["middlewares", "distinct", "aggregationsApi"]
}

Read on to learn about each feature individually!

Middlewares

Prisma Client's middleware lets you intercept Prisma Client queries to manipulate its parameters and interrogate its result. A middleware is a function that's passed to Prisma Client's $use method.

Middlewares are convenient for a number of use cases, for example:

  • Logging the time taken to perform a type of query
  • Manipulating or validating query parameters
  • Contacting another service upon specific queries

The following example includes two middlewares:

const prisma = new PrismaClient()

prisma.$use(async (params, next) => {
  const result = next(params);
  return result;
}

prisma.$use(async (params, next) => {
  return next(params);
}

📚 Documentation: Middleware

Remove duplicates from query results with distinct

Prisma Client allows you to filter duplicate rows from the response to a findMany query using the distinct option:

const distinctCities = await prisma.user.findMany({
  select: {
    city: true,
    country: true,
  },
  distinct: ["city"],
});

📚 Documentation: Distinct

Aggregations with aggregate

Prisma Client allows you to perform aggregations operations on the number fields (such as Int and Float) of a model - for example, you can get the average age of all users:

const aggregations = await prisma.user.aggregate({
  avg: {
    age: true,
  },
});

console.log("Average age:" + aggregations.avg.age);

Prisma Client supports the following aggregations:

  • avg (average)
  • sum (sum)
  • min (minimum value)
  • max (maximum value)

📚 Documentation: Aggregations

Preview features
New: Case insensitive filters (PostgreSQL only)

In 2.5.0 we introduce case insensitive filters for querying capabilities to Prisma Client. It allows you to query for fields in a case insensitive way.

Note: This feature will not work if you're using database collations that do not know how to convert between upper- and lowercase letters (e.g. the C collation).

📚 Documentation: Case sensitivity / Case-sensitive filtering

Feature flag

Insensitive filters querying needs to be enabled with the feature flag insensitiveFilters like so:

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["insensitiveFilters"]
}
Usage

The new mode option you can pass to findMany influences the corresponding filter (e.g. contains or startsWith) but doesn't change the return type of the findMany query. mode can have two possible values:

  • default: Uses the default filter configured on the database level. If the collation is configured as case insensitive in the database, the default mode will be case insensitive as well. In that case, there's no need to use the insensitive mode.
  • insensitive: Uses the case insensitive filter (if possible).
const result = await prisma.user.findMany({
  where: {
    email: {
      equals: 'lowercase@UPPERCASE.com',
      mode: 'insensitive',
    },
  },
})

Please share your feedback on how this feature works for you. We are interested in both positive and negative feedback, so we know if this feature is already ready for production! (If encounter any problems, please open a new issue here).

Feature flags for middlewares, distinct and aggregationApi removed

As mentioned above, we were able to promote three features into this stable release. This was thanks to your help and feedback, so please keep trying the preview features if they're useful to you and help us by sharing feedback.

Already existing preview features from 2.1.0

Just a quick reminder:

  • In version 2.1.0 we introduced two experimental features, namely connectOrCreate and transactionApi.

In case they're useful for you, please give them a try and share your feedback! These features remain in preview in this release.

🌟 Help us spread the word about Prisma

To help spread the word about Prisma, we'd very much appreciate if you would star this repo 🌟 And if you're excited about the features in this week's release, then help us and share it on Twitter.

Fixes and improvements
prisma
prisma-client-js
migrate
language-tools
studio
prisma-engines

v2.4.1

Compare Source

Today, we are issuing the 2.4.1 patch release.

When we released the new "Order by multiple fields" feature, you gave us feedback, that the order of properties is not stable in JavaScript. Since ES2015 that is not a problem in the language itself anymore.
However, some teams use the eslint sort-keys plugin, which sorts the keys of objects by alphabet.

Therefore we decided to change the API in a patch release to minimize any problems this might cause to you.

Order by multiple fields in 2.4.0
// order by `age` descending and then by `name` ascending
const users = await prisma.user.findMany({
  orderBy: {
    age: 'desc',
    name: 'asc'
  }
})
Order by multiple fields in 2.4.1
// order by `age` descending and then by `name` ascending
const data = await client.user.findMany({
  orderBy: [
    {
      age: 'desc',
    },
    {
      name: 'asc',
    },
  ],
})

v2.4.0

Compare Source

Today, we are issuing the 2.4.0 stable release.

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

Major improvements
Order by multiple fields

A long-awaited feature - the ability to order by multiple fields in Prisma Client is finally here!

Until now you could only order by a single scalar field of a model. The API design however was already prepared for ordering multiple fields with the object syntax we have. Instead of just one property, that orderBy object can now have as many fields as you want! The order of the fields hereby determines the order of the returned list (see example below).

Note: As this is an incremental change in the API, we introduce this feature without a feature flag.

You can use it like so:

// order by `age` descending and then by `name` ascending
const users = await prisma.user.findMany({
  orderBy: {
    age: 'desc',
    name: 'asc'
  }
})

As mentioned by the comment, the returned objects in users are ordered first by age (descending), and then by name (ascending).

📚 Documentation: Sort on multiple fields

Top-level Client Methods: $ dollar prefix for top-level Prisma Client methods

In recent versions, we introduced a couple of top-level methods in Prisma Client (e.g. prisma.transaction() and prisma.use()) in preview mode. The immediate feedback was that the denylist for model names grew - which breaks Prisma schemas where a model is called Transaction, transaction, use, or Use. And the list goes on...

In order to have a future-proof API, that allows maximum expressibility in terms of model names, we decided to prefix all non-query methods with a dollar sign $. That means Prisma Client will from now on ship with the following methods:

Pre-existing
  • $disconnect
  • $connect
  • $on
  • $queryRaw
  • $executeRaw
Still in preview
  • $use
  • $transaction

The preview methods have already been renamed, the pre-existing methods like connect are still available, you just get a deprecation warning. They will be available for a few more releases with an alias, so no hurry to update them yet.

Updates in Prisma Studio

With this release, we shipped a number of improvements for Prisma Studio:

  • Refreshed design
  • Moved the Reload button from the right of the databrowser to the left
  • Moved the Pending Actions bar from the bottom of the databrowser to the top right
  • Removed the sidebar; to open a model, you can now press the New Tab button on the top
  • Removed the code editor
  • Removed the tree view
  • Added ability to view and edit JSON fields

Try out Prisma Studio in the online demo or in your Prisma project by running:

npx prisma studio --experimental
Preview features
Changes to middlewares and transactionApi

As mentioned above, we ar changing the names of some the top-level Prisma Client methods. This affects the two preview features middlewares and transactionApi.

middlewares

You still need to enable the preview feature via the generator block in your Prisma schema to access it:

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["middlewares"]
}

Before

prisma.on()

After

prisma.$on()
transactionApi

You still need to enable the preview feature via the generator block in your Prisma schema to access it:

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["transactionApi"]
}

Before

prisma.transaction()

After

prisma.$transaction()
Already existing preview features from 2.1.0, 2.2.0, and 2.3.0

Just a quick reminder:

  • In version 2.1.0 we introduced two experimental features, namely connectOrCreate and transactionApi.
  • In 2.2.0 we introduced aggregateApi.
  • In 2.3.0 we introduced middlewares and the distinctApi.

In case they're useful for you, please give them a try and share your feedback! These features remain in preview in this release.

🌟 Help us spread the word about Prisma

To help spread the word about Prisma, we'd very much appreciate if you would star this repo 🌟 And if you're excited about the features in this week's release, then help us and share it on Twitter.

Fixes and improvements
prisma
prisma-client-js
migrate
language-tools
studio
prisma-engines

Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Enabled.

♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 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.

@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 6efddbf to 75b62e2 Compare September 3, 2020 12:14
@renovate renovate bot changed the title chore(deps): update prisma monorepo to v2.6.0 chore(deps): update prisma monorepo Sep 3, 2020
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 75b62e2 to 7195011 Compare September 3, 2020 12:17
@renovate renovate bot changed the title chore(deps): update prisma monorepo chore(deps): update prisma monorepo to v2.6.1 Sep 3, 2020
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 7195011 to 7de5e1a Compare September 4, 2020 14:24
@renovate renovate bot changed the title chore(deps): update prisma monorepo to v2.6.1 chore(deps): update prisma monorepo Sep 4, 2020
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 7de5e1a to 12e4e0d Compare September 4, 2020 14:26
@renovate renovate bot changed the title chore(deps): update prisma monorepo chore(deps): update prisma monorepo to v2.6.2 Sep 4, 2020
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 12e4e0d to 061b2b2 Compare September 15, 2020 12:26
@renovate renovate bot changed the title chore(deps): update prisma monorepo to v2.6.2 chore(deps): update prisma monorepo to v2.7.0 Sep 15, 2020
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 061b2b2 to c1b5f50 Compare September 16, 2020 16:10
@renovate renovate bot changed the title chore(deps): update prisma monorepo to v2.7.0 chore(deps): update prisma monorepo to v2.7.1 Sep 16, 2020
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from c1b5f50 to a767f3f Compare September 29, 2020 13:27
@renovate renovate bot changed the title chore(deps): update prisma monorepo to v2.7.1 chore(deps): update prisma monorepo to v2.8.0 Sep 29, 2020
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.

1 participant