Create a C# .NET core EntityFramework ORM from your schema.prisma file

Overview

A note of forewarning to the would-be user...

This was a failure. I'm making a note here: huge regret. It's hard to overstate my dissatisfaction. 🍰

So, I started to build this thinking "man, it really sucks that you can't create an EntityFramework client from a Prisma schema." Except I'm frequently incorrect on things, and oh by the way yes, yes you totally can create an EntityFramework client from Prisma, and without any code in-between. Here's an article on using prisma migrate to deploy your schema, and using the dotnet cli's entityframework introspection features to much more natively produce a client..

🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧

Shout out to @YassinEldeeb for building the awesome bootstrap project create-prisma-generator. Without it, this would have taken significantly more time to get into a deployable state.

prisma-generator-entityframework

Prisma. It's great, but if you're from the .NET clan, you're left standing out in the rain. Maybe there's still a way? What if the prisma.schema file could generate an EntityFramework client?

Usage

Step One

In your schema.prisma file, add a new generator called entityframework (or whatever you like):

// + generator entityframework {
// +   provider        = "npx prisma-generator-entityframework"
// +   output          = "../types"
// +   namespace       = "MyNamespace"
// +   clientClassName = "DataDbContext"
// + }

datasource db {
  provider = "postgresql"
  url      = "postgresql://user:password@my_postgres_host.com:5432/initial_db"
}

// Here's some example model code
model User {
  id      Int       @id @default(autoincrement())
  email   String    @unique
  name    String?
  posts   Post[]
  comment Comment[]

  @@map("system_user")
}

...

Step Two

Run prisma generate or npx prisma generate on your schema.

The prisma-generator-entityframework declaration you added will generate a C# EntityFramework client interface based on the models you have declared in your schema file.

Step Three

In your C# project(s), you now should be able to do things like:

using MyNamespace;

...

var context = new DataDbContext(); // if you're new to EntityFramework, it will come preconfigured with smarts to call your db connection, no batteries required!
context.User.Add(new User {
  email = "[email protected]",
  name = "John Doe",
});
context.SaveChanges();

Console.WriteLine(context.User.Where(user => user.name == "John Doe").First().email);
// [email protected]

Configuration

Configuration is as simple as providing values for these four properties:

Property Type Description
provider "npx prisma-generator-entityframework" Tell prisma you want to use this generator.
output string: relative or absolute path Tell prisma where you want the source code to be dumped to.
namespace string Tell prisma-generator-entityframework what namespace to stick your client and model code in.
clientClassName string Tell prisma-generator-entityframework what to name your DbContext subclass.

Compatibility

.NET support

Platform Version Support
.NET core 5.0+ βœ”οΈ
.NET core <5.0 ❔ (unverified)
.NET framework * ❌

Right now, the primary target is .NET core, version 5.0 and later. If enough any interest is communicated in suppporting .NET framework, it can certainly be prioritized.

Database support

Prisma connector Supported .NET core provider mapping
postgres βœ”οΈ Npgsql.EntityFrameworkCore.PostgreSQL
mysql βœ”οΈ Pomelo.EntityFrameworkCore.MySql
sqlite βœ”οΈ Microsoft.EntityFrameworkCore.Sqlite
sqlserver βœ”οΈ Microsoft.EntityFrameworkCore.SqlServer
cockroachdb ❌ -*
mongodb ❌ -

* It seems at least plausible to support CockroachDB, and given how compelling a product the CockroachLabs team have created, this should probably prioritized.

For more information on EntityFramework database provider support, visit the DbContext configuration guide.

For more information on Prisma-supported database connectors, visit the Prisma database connector documentation.

Feature support

The following table tracks feature availability. It's a good reference for verifying whether your schema will output with the information you need. Drop an issue if you'd like to see a specific feature prioritizied.

Feature Supported Description
model generation βœ”οΈ The system can generate basic models.
client generation βœ”οΈ The system can generate a basic client (DbContext in the EntityFramework world).
.env datasource βœ”οΈ The system can optionally configure the client from a .env file using the env() expression
relation generation βœ”οΈ The system can generate the code necessary to have object-to-object relations.
table/field mapping βœ”οΈ The system can detect @map and @@map annotations, and apply them accordingly.
array-type field mapping βœ”οΈ The system can detect whether a particular field is an array type.
@id mapping βœ”οΈ The system can map a primary key.
multi-field @id mapping βœ”οΈ The system can handle multi-field primary keys.
@default(uuid()) annotation mapping βœ”οΈ The system can specify a limited set of default values for primary key types: integer && string uuid.
@db.UniqueIdentifier, @db.Uuid βœ”οΈ The system can handle system-specific UUID (aka GUID) types.
@db* annotation mapping (postgres) βœ”οΈ The system can tell EntityFramework that your postgres @db annotations correspond to important underlying type mappings.
Basic Json type mapping βœ”οΈ The system can retrieve Json as a string type.*
Bytes type mapping βœ”οΈ The system can handle the Bytes type as a byte[]
Unsupported type mapping ❌ " " "
@default annotation mapping ❌ The system cannot yet apply the full range of model annotations based on the @default field annotation.
@db* annotation mapping ❌ The system cannot yet apply the full range of model annotations based on the @db.* and @dbgenerated field annotations, beyond postgres.
property/class case formating ❌ The system cannot yet massage case conventions, ie camelCase to PascalCase.
@index annotation mapping ❌ " " "
@ignore annotation mapping ❌ " " "
cuid/autoincrement/now ❌ " " ". Note that uuid is implemented for primary keys.
nuget dependency detection ❌ The system cannot yet autodetect that a nuget dependency is necessary to support the declared db provider.
enums generation ❌ The system cannot yet derive enums.
schema model argument mapping ❌ The system cannot yet handle model argument mapping.

* In the future, support may be added for extracting structured types out of json & jsonb fields.

Additional Links

Comments
  • build(deps-dev): bump prisma from 3.7.0 to 4.7.1 in /packages/generator

    build(deps-dev): bump prisma from 3.7.0 to 4.7.1 in /packages/generator

    Bumps prisma from 3.7.0 to 4.7.1.

    Release notes

    Sourced from prisma's releases.

    4.7.1

    Today, we are issuing the 4.7.1 patch release.

    Fixes in Prisma Client

    4.7.0

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

    Highlights

    Interactive transactions are now Generally Available

    After an extensive Preview phase and lots of great feedback from our community, we're excited to announce that interactiveTransactions is now Generally Available and production ready! πŸš€

    Interactive transactions allow you to pass an async function into a $transaction, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.

    Here are some of the feature highlights we've built:

    Here's an example of an interactive transaction with a Serializable isolation level:

    await prisma.$transaction(
      async (prisma) => {
        // Your transaction...
      },
      {
        isolationLevel: Prisma.TransactionIsolationLevel.Serializable,
        maxWait: 5000,
        timeout: 10000,
      }
    )
    

    You can now remove the interactiveTransactions Preview feature in your schema.

    Relation mode is Generally Available

    This release marks relationMode="prisma" as stable for our users working with databases that don't rely on foreign keys to manage relations. πŸŽ‰

    Prisma’s relation mode started as a way to support PlanetScale which does not allow you to create foreign keys for better online migration support. We transformed that into our Referential Integrity Emulation in 3.1.1 when we realised that more users could benefit from it, and then integrated it as the default mode for MongoDB, which generally does not have foreign keys. Prisma needed to use emulation to give the same guarantees.

    We then realized the feature was more than just referential integrity and affected how relations work. To reflect this, we renamed the feature to relation mode and the datasource property to relationMode in 4.5.0

    ... (truncated)

    Commits
    • 92d2d1c fix(validate,format): disable warnings when PRISMA_DISABLE_WARNINGS is truthy...
    • 8d8a1ed feat(validate): add lint warnings (#16458)
    • 3077f50 feat(internals): add support for lint warnings to prisma format (#16270)
    • 7ebc4c7 chore(deps): update studio to v0.477.0 (#16284)
    • 43580a8 fix(cli): don't crash when checking for updates from integration version with...
    • eeccf09 test(cli): validate, add to help with missing tests (#16008)
    • 08862d3 chore(deps): update engines to 4.7.0-7.8b67711d15549e23304b0bae4b75e170e77f48...
    • 9047e95 chore(deps): update devdependencies (non-major)
    • 5878965 chore: types for watch mode (#15989)
    • dad9bc6 feat(wasm): add support for Wasm'd getConfig (#15588)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump @prisma/generator-helper from 3.7.0 to 4.7.1 in /packages/generator

    build(deps): bump @prisma/generator-helper from 3.7.0 to 4.7.1 in /packages/generator

    Bumps @prisma/generator-helper from 3.7.0 to 4.7.1.

    Release notes

    Sourced from @​prisma/generator-helper's releases.

    4.7.1

    Today, we are issuing the 4.7.1 patch release.

    Fixes in Prisma Client

    4.7.0

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

    Highlights

    Interactive transactions are now Generally Available

    After an extensive Preview phase and lots of great feedback from our community, we're excited to announce that interactiveTransactions is now Generally Available and production ready! πŸš€

    Interactive transactions allow you to pass an async function into a $transaction, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.

    Here are some of the feature highlights we've built:

    Here's an example of an interactive transaction with a Serializable isolation level:

    await prisma.$transaction(
      async (prisma) => {
        // Your transaction...
      },
      {
        isolationLevel: Prisma.TransactionIsolationLevel.Serializable,
        maxWait: 5000,
        timeout: 10000,
      }
    )
    

    You can now remove the interactiveTransactions Preview feature in your schema.

    Relation mode is Generally Available

    This release marks relationMode="prisma" as stable for our users working with databases that don't rely on foreign keys to manage relations. πŸŽ‰

    Prisma’s relation mode started as a way to support PlanetScale which does not allow you to create foreign keys for better online migration support. We transformed that into our Referential Integrity Emulation in 3.1.1 when we realised that more users could benefit from it, and then integrated it as the default mode for MongoDB, which generally does not have foreign keys. Prisma needed to use emulation to give the same guarantees.

    We then realized the feature was more than just referential integrity and affected how relations work. To reflect this, we renamed the feature to relation mode and the datasource property to relationMode in 4.5.0

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump @prisma/generator-helper from 3.7.0 to 4.7.0 in /packages/generator

    build(deps): bump @prisma/generator-helper from 3.7.0 to 4.7.0 in /packages/generator

    Bumps @prisma/generator-helper from 3.7.0 to 4.7.0.

    Release notes

    Sourced from @​prisma/generator-helper's releases.

    4.7.0

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

    Highlights

    Interactive transactions are now Generally Available

    After an extensive Preview phase and lots of great feedback from our community, we're excited to announce that interactiveTransactions is now Generally Available and production ready! πŸš€

    Interactive transactions allow you to pass an async function into a $transaction, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.

    Here are some of the feature highlights we've built:

    Here's an example of an interactive transaction with a Serializable isolation level:

    await prisma.$transaction(
      async (prisma) => {
        // Your transaction...
      },
      {
        isolationLevel: Prisma.TransactionIsolationLevel.Serializable,
        maxWait: 5000,
        timeout: 10000,
      }
    )
    

    You can now remove the interactiveTransactions Preview feature in your schema.

    Relation mode is Generally Available

    This release marks relationMode="prisma" as stable for our users working with databases that don't rely on foreign keys to manage relations. πŸŽ‰

    Prisma’s relation mode started as a way to support PlanetScale which does not allow you to create foreign keys for better online migration support. We transformed that into our Referential Integrity Emulation in 3.1.1 when we realised that more users could benefit from it, and then integrated it as the default mode for MongoDB, which generally does not have foreign keys. Prisma needed to use emulation to give the same guarantees.

    We then realized the feature was more than just referential integrity and affected how relations work. To reflect this, we renamed the feature to relation mode and the datasource property to relationMode in 4.5.0

    Index warnings for relationMode = "prisma"

    In this release, we've added a warning to our Prisma schema validation that informs you that the lack of foreign keys might result in slower performance β€” and that you should add an @@index manually to your schema to counter that. This ensures your queries are equally fast in relation mode prisma as they are with foreign keys.

    With relationMode = "prisma", no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to slower performance when querying these fields. We recommend manually adding an index.

    We also added a fix to our VS Code extension to help adding the suggested index with minimal effort:

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps-dev): bump prisma from 3.7.0 to 4.7.0 in /packages/generator

    build(deps-dev): bump prisma from 3.7.0 to 4.7.0 in /packages/generator

    Bumps prisma from 3.7.0 to 4.7.0.

    Release notes

    Sourced from prisma's releases.

    4.7.0

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

    Highlights

    Interactive transactions are now Generally Available

    After an extensive Preview phase and lots of great feedback from our community, we're excited to announce that interactiveTransactions is now Generally Available and production ready! πŸš€

    Interactive transactions allow you to pass an async function into a $transaction, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.

    Here are some of the feature highlights we've built:

    Here's an example of an interactive transaction with a Serializable isolation level:

    await prisma.$transaction(
      async (prisma) => {
        // Your transaction...
      },
      {
        isolationLevel: Prisma.TransactionIsolationLevel.Serializable,
        maxWait: 5000,
        timeout: 10000,
      }
    )
    

    You can now remove the interactiveTransactions Preview feature in your schema.

    Relation mode is Generally Available

    This release marks relationMode="prisma" as stable for our users working with databases that don't rely on foreign keys to manage relations. πŸŽ‰

    Prisma’s relation mode started as a way to support PlanetScale which does not allow you to create foreign keys for better online migration support. We transformed that into our Referential Integrity Emulation in 3.1.1 when we realised that more users could benefit from it, and then integrated it as the default mode for MongoDB, which generally does not have foreign keys. Prisma needed to use emulation to give the same guarantees.

    We then realized the feature was more than just referential integrity and affected how relations work. To reflect this, we renamed the feature to relation mode and the datasource property to relationMode in 4.5.0

    Index warnings for relationMode = "prisma"

    In this release, we've added a warning to our Prisma schema validation that informs you that the lack of foreign keys might result in slower performance β€” and that you should add an @@index manually to your schema to counter that. This ensures your queries are equally fast in relation mode prisma as they are with foreign keys.

    With relationMode = "prisma", no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to slower performance when querying these fields. We recommend manually adding an index.

    We also added a fix to our VS Code extension to help adding the suggested index with minimal effort:

    ... (truncated)

    Commits
    • 92d2d1c fix(validate,format): disable warnings when PRISMA_DISABLE_WARNINGS is truthy...
    • 8d8a1ed feat(validate): add lint warnings (#16458)
    • 3077f50 feat(internals): add support for lint warnings to prisma format (#16270)
    • 7ebc4c7 chore(deps): update studio to v0.477.0 (#16284)
    • 43580a8 fix(cli): don't crash when checking for updates from integration version with...
    • eeccf09 test(cli): validate, add to help with missing tests (#16008)
    • 08862d3 chore(deps): update engines to 4.7.0-7.8b67711d15549e23304b0bae4b75e170e77f48...
    • 9047e95 chore(deps): update devdependencies (non-major)
    • 5878965 chore: types for watch mode (#15989)
    • dad9bc6 feat(wasm): add support for Wasm'd getConfig (#15588)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps-dev): bump typescript from 4.5.2 to 4.9.3 in /packages/generator

    build(deps-dev): bump typescript from 4.5.2 to 4.9.3 in /packages/generator

    Bumps typescript from 4.5.2 to 4.9.3.

    Release notes

    Sourced from typescript's releases.

    TypeScript 4.8.4

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    TypeScript 4.8.3

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    TypeScript 4.8

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    TypeScript 4.8 RC

    For release notes, check out the release announcement.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps-dev): bump prisma from 3.7.0 to 4.6.1 in /packages/generator

    build(deps-dev): bump prisma from 3.7.0 to 4.6.1 in /packages/generator

    Bumps prisma from 3.7.0 to 4.6.1.

    Release notes

    Sourced from prisma's releases.

    4.6.1

    Today, we are issuing the 4.6.1 patch release.

    Fixes in Prisma Client

    Fix in Prisma Migrate

    4.6.0

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

    Highlights

    Interactive Transactions for Prisma Data Proxy (Preview)

    In 3.8.0, we disabled the interactiveTransactions Preview feature when using the Prisma Data Proxy. This was because the API was not yet supported.

    In this release, we're removing the limitation. You can now try the Preview version of interactive transactions with the Prisma Data Proxy. Re-generate Prisma Client using prisma generate --data-proxy after enabling the Preview feature.

    Note: The interactiveTransactions Preview feature flag is still needed. We will remove this in a future version when the feature is stable.

    Try it out and let us know your thoughts in our interactive transactions feedback GitHub issue.

    Native database level upserts for PostgreSQL, SQLite, and CockroachDB

    Prisma’s upsert is one of its most powerful and most convenient APIs. In this release, Prisma will now default to the native database upsert for PostgreSQL, SQLite, and CockroachDB whenever possible.

    Prisma will use the native database upsert if:

    • There are no nested queries in the upsert's create and update options
    • The query modifies only one model
    • There is only one unique field in the upsert's where option
    • The unique field in the where option and the unique field in the create option have the same value

    Prisma Client's upsert operation was implemented on a Prisma-level and did not use the native database implementations like, e.g., INSERT .. ON CONFLICT .. UPDATE SET. This allowed Prisma to also upsert nested queries.

    The Prisma-implementation came at a cost. In some scenarios, it was more likely for a transaction to roll back because of a conflict when multiple upsert operations were being executed in parallel, and the multiple queries often took longer than the native database query would have taken.

    Try it out and let us know what you think. If you run into any issues, don't hesitate to create a GitHub issue.

    Relation Mode improvements (Preview)

    In 4.5.0, we renamed the "Referential Integrity" Preview feature to "Relation Mode". We also changed the datasource property name of the feature to relationMode.

    In this release, we fixed all remaining known bugs of relationMode = "prisma" and cleaned up our documentation. You can now read about Relation mode on its own documentation page which is up to date with the implementation.

    If you encounter any problems please comment on our feedback issue. We plan to make this Generally Available soon.

    ... (truncated)

    Commits
    • 9047e95 chore(deps): update devdependencies (non-major)
    • 5878965 chore: types for watch mode (#15989)
    • dad9bc6 feat(wasm): add support for Wasm'd getConfig (#15588)
    • 7677fd9 chore(deps): update jest (#15429)
    • aa3aaff chore(deps): update devdependencies (non-major)
    • 8ef1cc1 chore(deps): update devdependencies (non-major)
    • 0b204fa test: ensure the emulated referential action NoAction is invalid for postgr...
    • f7bb466 chore(deps): update studio to 0.476.0 (#15858)
    • 187470c fix(cli): deno + dataproxy message (#15847)
    • 1343c82 feat(client): preview feature deno (#15281)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump @prisma/generator-helper from 3.7.0 to 4.6.1 in /packages/generator

    build(deps): bump @prisma/generator-helper from 3.7.0 to 4.6.1 in /packages/generator

    Bumps @prisma/generator-helper from 3.7.0 to 4.6.1.

    Release notes

    Sourced from @​prisma/generator-helper's releases.

    4.6.1

    Today, we are issuing the 4.6.1 patch release.

    Fixes in Prisma Client

    Fix in Prisma Migrate

    4.6.0

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

    Highlights

    Interactive Transactions for Prisma Data Proxy (Preview)

    In 3.8.0, we disabled the interactiveTransactions Preview feature when using the Prisma Data Proxy. This was because the API was not yet supported.

    In this release, we're removing the limitation. You can now try the Preview version of interactive transactions with the Prisma Data Proxy. Re-generate Prisma Client using prisma generate --data-proxy after enabling the Preview feature.

    Note: The interactiveTransactions Preview feature flag is still needed. We will remove this in a future version when the feature is stable.

    Try it out and let us know your thoughts in our interactive transactions feedback GitHub issue.

    Native database level upserts for PostgreSQL, SQLite, and CockroachDB

    Prisma’s upsert is one of its most powerful and most convenient APIs. In this release, Prisma will now default to the native database upsert for PostgreSQL, SQLite, and CockroachDB whenever possible.

    Prisma will use the native database upsert if:

    • There are no nested queries in the upsert's create and update options
    • The query modifies only one model
    • There is only one unique field in the upsert's where option
    • The unique field in the where option and the unique field in the create option have the same value

    Prisma Client's upsert operation was implemented on a Prisma-level and did not use the native database implementations like, e.g., INSERT .. ON CONFLICT .. UPDATE SET. This allowed Prisma to also upsert nested queries.

    The Prisma-implementation came at a cost. In some scenarios, it was more likely for a transaction to roll back because of a conflict when multiple upsert operations were being executed in parallel, and the multiple queries often took longer than the native database query would have taken.

    Try it out and let us know what you think. If you run into any issues, don't hesitate to create a GitHub issue.

    Relation Mode improvements (Preview)

    In 4.5.0, we renamed the "Referential Integrity" Preview feature to "Relation Mode". We also changed the datasource property name of the feature to relationMode.

    In this release, we fixed all remaining known bugs of relationMode = "prisma" and cleaned up our documentation. You can now read about Relation mode on its own documentation page which is up to date with the implementation.

    If you encounter any problems please comment on our feedback issue. We plan to make this Generally Available soon.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump @prisma/generator-helper from 3.7.0 to 4.6.0 in /packages/generator

    build(deps): bump @prisma/generator-helper from 3.7.0 to 4.6.0 in /packages/generator

    Bumps @prisma/generator-helper from 3.7.0 to 4.6.0.

    Release notes

    Sourced from @​prisma/generator-helper's releases.

    4.6.0

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

    Highlights

    Interactive Transactions for Prisma Data Proxy (Preview)

    In 3.8.0, we disabled the interactiveTransactions Preview feature when using the Prisma Data Proxy. This was because the API was not yet supported.

    In this release, we're removing the limitation. You can now try the Preview version of interactive transactions with the Prisma Data Proxy. Re-generate Prisma Client using prisma generate --data-proxy after enabling the Preview feature.

    Note: The interactiveTransactions Preview feature flag is still needed. We will remove this in a future version when the feature is stable.

    Try it out and let us know your thoughts in our interactive transactions feedback GitHub issue.

    Native database level upserts for PostgreSQL, SQLite, and CockroachDB

    Prisma’s upsert is one of its most powerful and most convenient APIs. In this release, Prisma will now default to the native database upsert for PostgreSQL, SQLite, and CockroachDB whenever possible.

    Prisma will use the native database upsert if:

    • There are no nested queries in the upsert's create and update options
    • The query modifies only one model
    • There is only one unique field in the upsert's where option
    • The unique field in the where option and the unique field in the create option have the same value

    Prisma Client's upsert operation was implemented on a Prisma-level and did not use the native database implementations like, e.g., INSERT .. ON CONFLICT .. UPDATE SET. This allowed Prisma to also upsert nested queries.

    The Prisma-implementation came at a cost. In some scenarios, it was more likely for a transaction to roll back because of a conflict when multiple upsert operations were being executed in parallel, and the multiple queries often took longer than the native database query would have taken.

    Try it out and let us know what you think. If you run into any issues, don't hesitate to create a GitHub issue.

    Relation Mode improvements (Preview)

    In 4.5.0, we renamed the "Referential Integrity" Preview feature to "Relation Mode". We also changed the datasource property name of the feature to relationMode.

    In this release, we fixed all remaining known bugs of relationMode = "prisma" and cleaned up our documentation. You can now read about Relation mode on its own documentation page which is up to date with the implementation.

    If you encounter any problems please comment on our feedback issue. We plan to make this Generally Available soon.

    extendedWhereUnique improvements (Preview)

    In 4.5.0, we introduced the extendedWhereUnique Preview feature to allow filtering for non-unique properties in unique where queries. In this release, we're adding new rules to decide when concurrent findUnique queries get batched into a findMany query.

    Unfortunately, we forgot to adapt our findUnique query batch optimization, which turns multiple concurrent findUnique queries into a single findMany query when possible β€” GitHub issue.

    Therefore, findUnique queries will get batched into a findMany query if:

    • All criteria of the filter must be on scalar fields (unique or non-unique) of the same model you're querying
    • All criteria must use the equal's filter, whether that's via the shorthand or explicit syntax (where: { field: <val>, field1: { equals: <val> } })

    Conversely, suppose the filter object contains any boolean operators, relation filters, or scalar filters that are not using equals. Prisma will fall back to executing the findUnique queries independently.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps-dev): bump prisma from 3.7.0 to 4.6.0 in /packages/generator

    build(deps-dev): bump prisma from 3.7.0 to 4.6.0 in /packages/generator

    Bumps prisma from 3.7.0 to 4.6.0.

    Release notes

    Sourced from prisma's releases.

    4.6.0

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

    Highlights

    Interactive Transactions for Prisma Data Proxy (Preview)

    In 3.8.0, we disabled the interactiveTransactions Preview feature when using the Prisma Data Proxy. This was because the API was not yet supported.

    In this release, we're removing the limitation. You can now try the Preview version of interactive transactions with the Prisma Data Proxy. Re-generate Prisma Client using prisma generate --data-proxy after enabling the Preview feature.

    Note: The interactiveTransactions Preview feature flag is still needed. We will remove this in a future version when the feature is stable.

    Try it out and let us know your thoughts in our interactive transactions feedback GitHub issue.

    Native database level upserts for PostgreSQL, SQLite, and CockroachDB

    Prisma’s upsert is one of its most powerful and most convenient APIs. In this release, Prisma will now default to the native database upsert for PostgreSQL, SQLite, and CockroachDB whenever possible.

    Prisma will use the native database upsert if:

    • There are no nested queries in the upsert's create and update options
    • The query modifies only one model
    • There is only one unique field in the upsert's where option
    • The unique field in the where option and the unique field in the create option have the same value

    Prisma Client's upsert operation was implemented on a Prisma-level and did not use the native database implementations like, e.g., INSERT .. ON CONFLICT .. UPDATE SET. This allowed Prisma to also upsert nested queries.

    The Prisma-implementation came at a cost. In some scenarios, it was more likely for a transaction to roll back because of a conflict when multiple upsert operations were being executed in parallel, and the multiple queries often took longer than the native database query would have taken.

    Try it out and let us know what you think. If you run into any issues, don't hesitate to create a GitHub issue.

    Relation Mode improvements (Preview)

    In 4.5.0, we renamed the "Referential Integrity" Preview feature to "Relation Mode". We also changed the datasource property name of the feature to relationMode.

    In this release, we fixed all remaining known bugs of relationMode = "prisma" and cleaned up our documentation. You can now read about Relation mode on its own documentation page which is up to date with the implementation.

    If you encounter any problems please comment on our feedback issue. We plan to make this Generally Available soon.

    extendedWhereUnique improvements (Preview)

    In 4.5.0, we introduced the extendedWhereUnique Preview feature to allow filtering for non-unique properties in unique where queries. In this release, we're adding new rules to decide when concurrent findUnique queries get batched into a findMany query.

    Unfortunately, we forgot to adapt our findUnique query batch optimization, which turns multiple concurrent findUnique queries into a single findMany query when possible β€” GitHub issue.

    Therefore, findUnique queries will get batched into a findMany query if:

    • All criteria of the filter must be on scalar fields (unique or non-unique) of the same model you're querying
    • All criteria must use the equal's filter, whether that's via the shorthand or explicit syntax (where: { field: <val>, field1: { equals: <val> } })

    Conversely, suppose the filter object contains any boolean operators, relation filters, or scalar filters that are not using equals. Prisma will fall back to executing the findUnique queries independently.

    ... (truncated)

    Commits
    • 9047e95 chore(deps): update devdependencies (non-major)
    • 5878965 chore: types for watch mode (#15989)
    • dad9bc6 feat(wasm): add support for Wasm'd getConfig (#15588)
    • 7677fd9 chore(deps): update jest (#15429)
    • aa3aaff chore(deps): update devdependencies (non-major)
    • 8ef1cc1 chore(deps): update devdependencies (non-major)
    • 0b204fa test: ensure the emulated referential action NoAction is invalid for postgr...
    • f7bb466 chore(deps): update studio to 0.476.0 (#15858)
    • 187470c fix(cli): deno + dataproxy message (#15847)
    • 1343c82 feat(client): preview feature deno (#15281)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump @prisma/generator-helper from 3.7.0 to 4.5.0 in /packages/generator

    build(deps): bump @prisma/generator-helper from 3.7.0 to 4.5.0 in /packages/generator

    Bumps @prisma/generator-helper from 3.7.0 to 4.5.0.

    Release notes

    Sourced from @​prisma/generator-helper's releases.

    4.5.0

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

    Major improvements

    Filter for non-unique properties in unique where queries (Preview)

    In this release, we are adding support for non-unique properties inside the where statement for queries that operate on a unique record (e.g.: findUnique, update, delete, etc.). This was not possible in the past, as we only allowed unique fields as filters inside the where statement for the queries in question.

    There are use cases where a query that operates on a unique record requires further filtering by non-unique properties. For example, for the following model:

    model Article {
      id      Int    @id @default(autoincrement())
      content String
      version Int
    }
    

    Let’s say that you would like to update the Article with an id of β€œ5”, but only if the version equals "1":

    await prisma.article.update({
        where: { id: 5, version: 1 }, // `version` field was not available before Prisma 4.5.0
        data: {
            content: "Incredible new story",
            version: { increment: 1 },
        },
    });
    

    With 4.5.0, we are adding support to specify any number of non-unique fields in your where statement, as long as you have at least one unique field.

    To use it, enable the Preview feature flag:

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

    To learn more about this feature and about use cases where it can be useful, please check out our documentation. For feedback, please leave a comment on the GitHub issue.

    PostgreSQL extension management (Preview)

    We are excited to add support for declaring PostgreSQL extensions in the Prisma schema. The feature comes with support for introspection and migrations. This will allow you to adopt, evolve and manage whichΒ PostgreSQL database extensions are installed directly from within your Prisma schema.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps-dev): bump prisma from 3.7.0 to 4.5.0 in /packages/generator

    build(deps-dev): bump prisma from 3.7.0 to 4.5.0 in /packages/generator

    Bumps prisma from 3.7.0 to 4.5.0.

    Release notes

    Sourced from prisma's releases.

    4.5.0

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

    Major improvements

    Filter for non-unique properties in unique where queries (Preview)

    In this release, we are adding support for non-unique properties inside the where statement for queries that operate on a unique record (e.g.: findUnique, update, delete, etc.). This was not possible in the past, as we only allowed unique fields as filters inside the where statement for the queries in question.

    There are use cases where a query that operates on a unique record requires further filtering by non-unique properties. For example, for the following model:

    model Article {
      id      Int    @id @default(autoincrement())
      content String
      version Int
    }
    

    Let’s say that you would like to update the Article with an id of β€œ5”, but only if the version equals "1":

    await prisma.article.update({
        where: { id: 5, version: 1 }, // `version` field was not available before Prisma 4.5.0
        data: {
            content: "Incredible new story",
            version: { increment: 1 },
        },
    });
    

    With 4.5.0, we are adding support to specify any number of non-unique fields in your where statement, as long as you have at least one unique field.

    To use it, enable the Preview feature flag:

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

    To learn more about this feature and about use cases where it can be useful, please check out our documentation. For feedback, please leave a comment on the GitHub issue.

    PostgreSQL extension management (Preview)

    We are excited to add support for declaring PostgreSQL extensions in the Prisma schema. The feature comes with support for introspection and migrations. This will allow you to adopt, evolve and manage whichΒ PostgreSQL database extensions are installed directly from within your Prisma schema.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Wow! This looks awesome man!!

    Wow! This looks awesome man!!

    glad you found the create-prisma-generator cli useful, really happy to see people building such advanced generators when they have an easy way to start. Let me know about any bugs/issues or missing documentation that'd be helpful to add to improve the experience for other people.

    please feel free to close this issue

    opened by YassinEldeeb 0
  • build(deps-dev): bump @types/prettier from 2.4.2 to 2.7.2 in /packages/generator

    build(deps-dev): bump @types/prettier from 2.4.2 to 2.7.2 in /packages/generator

    Bumps @types/prettier from 2.4.2 to 2.7.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump @prisma/generator-helper from 3.7.0 to 4.8.0 in /packages/generator

    build(deps): bump @prisma/generator-helper from 3.7.0 to 4.8.0 in /packages/generator

    Bumps @prisma/generator-helper from 3.7.0 to 4.8.0.

    Release notes

    Sourced from @​prisma/generator-helper's releases.

    4.8.0

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

    Highlights

    Improved serverless experience β€” smaller engines size

    In this release, we have decreased the size of our engine files by an average of 50%. The size of the Query Engine used on Debian, with OpenSSL 3.0.x, for example, went from 39MB to 14MB. We will also remove some smaller engines to decrease the total size in future versions.

    Additionally, we have started optimizing how the Prisma schema is loaded in Prisma Client. You should notice a considerable improvement when executing the first query if you're working with a bigger schema with many models and relations.

    We will continue investing in this direction in the next releases and further improve the experience with Prisma and serverless environments.

    Multi-schema support for CockroachDB (Preview)

    We're pleased to share that this release adds Preview support for multi-schema for CockroachDB. πŸŽ‰

    This release adds support for:

    • Introspecting databases that organize objects in multiple database schemas
    • Managing multi-schema database setups directly from Prisma schema
    • Generating migrations that are database schema-aware with Prisma Migrate
    • Querying across multiple database schemas with Prisma Client

    If you already have a CockroachDB database using multiple schemas, you can quickly get up and running set up multiple schemas by:

    • Enabling the Preview feature in the Prisma schema
    • Defining the schemas in the schemas property in the datasource block
    • Introspecting your database using prisma db pull

    You can further evolve your database schema using the multi-schema Preview feature by using prisma migrate dev.

    For further details, refer to our documentation and let us know what you think in this GitHub issue.

    Improved OpenSSL 3.x support

    Prisma now supports OpenSSL 3 builds for Linux Alpine on x86_64 architectures. This particularly impacts users running Prisma on node:alpine and node:lts-alpine Docker images. The images are based on an Alpine version that ships with OpenSSL 3.0.x, which isn’t compatible with OpenSSL 1.1.x (already supported by Prisma). You can read more details about it in this GitHub comment.

    We also have rewritten our OpenSSL version detection logic, making it future-proof. We now expect Prisma to support systems running with any OpenSSL 3 minor versions out of the box.

    Fixes and improvements

    Prisma

    ... (truncated)

    Commits
    • a3cdde6 chore(deps): update dependency @​types/jest to v29.2.4
    • 100d191 chore(deps): update jest (major) (#15107)
    • a6bb287 tmp: changes to TSClient/Args
    • 30cda05 Remove usages of client actions
    • 9047e95 chore(deps): update devdependencies (non-major)
    • 7677fd9 chore(deps): update jest (#15429)
    • 92ae09f test(client): Fix flaky generator test (#15956)
    • 8ef1cc1 chore(deps): update devdependencies (non-major)
    • 10f3af2 feat(client): extended where (#15787)
    • f2de612 chore(deps): update devdependencies (non-major) (#15752)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • build(deps-dev): bump prisma from 3.7.0 to 4.8.0 in /packages/generator

    build(deps-dev): bump prisma from 3.7.0 to 4.8.0 in /packages/generator

    Bumps prisma from 3.7.0 to 4.8.0.

    Release notes

    Sourced from prisma's releases.

    4.8.0

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

    Highlights

    Improved serverless experience β€” smaller engines size

    In this release, we have decreased the size of our engine files by an average of 50%. The size of the Query Engine used on Debian, with OpenSSL 3.0.x, for example, went from 39MB to 14MB. We will also remove some smaller engines to decrease the total size in future versions.

    Additionally, we have started optimizing how the Prisma schema is loaded in Prisma Client. You should notice a considerable improvement when executing the first query if you're working with a bigger schema with many models and relations.

    We will continue investing in this direction in the next releases and further improve the experience with Prisma and serverless environments.

    Multi-schema support for CockroachDB (Preview)

    We're pleased to share that this release adds Preview support for multi-schema for CockroachDB. πŸŽ‰

    This release adds support for:

    • Introspecting databases that organize objects in multiple database schemas
    • Managing multi-schema database setups directly from Prisma schema
    • Generating migrations that are database schema-aware with Prisma Migrate
    • Querying across multiple database schemas with Prisma Client

    If you already have a CockroachDB database using multiple schemas, you can quickly get up and running set up multiple schemas by:

    • Enabling the Preview feature in the Prisma schema
    • Defining the schemas in the schemas property in the datasource block
    • Introspecting your database using prisma db pull

    You can further evolve your database schema using the multi-schema Preview feature by using prisma migrate dev.

    For further details, refer to our documentation and let us know what you think in this GitHub issue.

    Improved OpenSSL 3.x support

    Prisma now supports OpenSSL 3 builds for Linux Alpine on x86_64 architectures. This particularly impacts users running Prisma on node:alpine and node:lts-alpine Docker images. The images are based on an Alpine version that ships with OpenSSL 3.0.x, which isn’t compatible with OpenSSL 1.1.x (already supported by Prisma). You can read more details about it in this GitHub comment.

    We also have rewritten our OpenSSL version detection logic, making it future-proof. We now expect Prisma to support systems running with any OpenSSL 3 minor versions out of the box.

    Fixes and improvements

    Prisma

    ... (truncated)

    Commits
    • e6e95ea perf(client): Use dmmf from a running engine (#16798)
    • 2b9bcd8 fix(version): set ignoreEnvVarErrors: true (#16902)
    • a3cdde6 chore(deps): update dependency @​types/jest to v29.2.4
    • 5cb09a0 chore(deps): update studio to v0.479.0
    • 100d191 chore(deps): update jest (major) (#15107)
    • a94ca96 chore: update back to ubuntu-latest on CI (#16575)
    • 707836a fix(deps): update dependency fs-extra to v11 (#16513)
    • 97d1010 chore(deps): update studio to v0.478.0
    • 92d2d1c fix(validate,format): disable warnings when PRISMA_DISABLE_WARNINGS is truthy...
    • 8d8a1ed feat(validate): add lint warnings (#16458)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • build(deps-dev): bump typescript from 4.5.2 to 4.9.4 in /packages/generator

    build(deps-dev): bump typescript from 4.5.2 to 4.9.4 in /packages/generator

    Bumps typescript from 4.5.2 to 4.9.4.

    Release notes

    Sourced from typescript's releases.

    TypeScript 4.9.4

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    Changes:

    • e2868216f637e875a74c675845625eb15dcfe9a2 Bump version to 4.9.4 and LKG.
    • eb5419fc8d980859b98553586dfb5f40d811a745 Cherry-pick #51704 to release 4.9 (#51712)
    • b4d382b9b12460adf2da4cc0d1429cf19f8dc8be Cherry-pick changes for narrowing to tagged literal types.
    • e7a02f43fce47e1a39259ada5460bcc33c8e98b5 Port of #51626 and #51689 to release-4.9 (#51627)
    • 1727912f0437a7f367d90040fc4b0b4f3efd017a Cherry-pick fix around visitEachChild to release-4.9. (#51544)

    This list of changes was auto generated.

    TypeScript 4.9

    For release notes, check out the release announcement.

    Downloads are available on:

    Changes:

    • 93bd577458d55cd720b2677705feab5c91eb12ce Bump version to 4.9.3 and LKG.
    • 107f832b80df2dc97748021cb00af2b6813db75b Update LKG.
    • 31bee5682df130a14ffdd5742f994dbe7313dd0e Cherry-pick PR #50977 into release-4.9 (#51363) [ #50872 ]
    • 1e2fa7ae15f8530910fef8b916ec8a4ed0b59c45 Update version to 4.9.2-rc and LKG.
    • 7ab89e5c6e401d161f31f28a6c555a3ba530910e Merge remote-tracking branch 'origin/main' into release-4.9
    • e5cd686defb1a4cbdb36bd012357ba5bed28f371 Update package-lock.json
    • 8d40dc15d1b9945837e7860320fdccfe27c40cad Update package-lock.json
    • 5cfb3a2fe344a5350734305193e6cc99516285ca Only call return() for an abrupt completion in user code (#51297)
    • a7a9d158e817fcb0e94dc1c24e0a401b21be0cc9 Fix for broken baseline in yieldInForInInDownlevelGenerator (#51345)
    • 7f8426f4df0d0a7dd8b72079dafc3e60164a23b1 fix for-in enumeration containing yield in generator (#51295)
    • 3d2b4017eb6b9a2b94bc673291e56ae95e8beddd Fix assertion functions accessed via wildcard imports (#51324)
    • 64d0d5ae140b7b26a09e75114517b418d6bcaa9f fix(51301): Fixing an unused import at the end of a line removes the newline (#51320)
    • 754eeb2986bde30d5926e0fa99c87dda9266d01b Update CodeQL workflow and configuration, fix found bugs (#51263)
    • d8aad262006ad2d2c91aa7a0e4449b4b83c57f7b Update package-lock.json
    • d4f26c840b1db76c0b25a405c8e73830a2b45cbc fix(51245): Class with parameter decorator in arrow function causes "convert to default export" refactoring failure (#51256)
    • 16faf45682173ea437a50330feb4785578923d7f Update package-lock.json
    • 8b1ecdb701e2a2e19e9f8bcdd6b2beac087eabee fix(50654): "Move to a new file" breaks the declaration of referenced variable (#50681)
    • 170a17fad57eae619c5ef2b7bdb3ac00d6c32c47 Dom update 2022-10-25 (#51300)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump @prisma/sdk from 3.7.0 to 4.0.0 in /packages/generator

    build(deps): bump @prisma/sdk from 3.7.0 to 4.0.0 in /packages/generator

    Bumps @prisma/sdk from 3.7.0 to 4.0.0.

    Release notes

    Sourced from @​prisma/sdk's releases.

    4.0.0

    We're excited to share the 4.0.0 stable release today. πŸŽ‰

    Prisma 4.0.0 features a variety of improvements across Prisma Migrate, Prisma schema, and Prisma Client. These changes will impact most Prisma users, particularly those who used some of our most popular Preview features around advanced index management, raw SQL queries, and filtering rows by properties of JSON.

    As this is a major release, we included many breaking bug fixes and other enhancements, but we believe upgrading is worthwhile. You can learn about upgrading in our Prisma 4 Upgrade guide.

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

    Major improvements

    Here's a TL;DR:

    • Preview features moved to General Availability
      • extendedIndexes
      • filterJson
      • improvedQueryRaw
    • Improvements to the Prisma Schema
      • Defaults values for scalar lists (arrays)
      • Improved default support for embedded documents
      • Explicit unique constraints for 1:1 relations
      • Removed support for usage of references on implicit m:n relations
      • Enforcing uniqueness of referenced fields in the references argument in 1:1 and 1:m relations for MySQL
      • Removal of undocumented support for the type alias
      • Removal of the sqlite protocol for SQLite URLs
      • Better grammar for string literals
    • New Prisma Client APIs
      • findUniqueOrThrow
      • findFirstOrThrow
    • General improvements
      • Deprecating rejectOnNotFound
      • Fix rounding errors on big numbers in SQLite
      • DbNull, JsonNull, and AnyNull are now objects
      • Prisma Studio updates
      • Dropped support for Node 12
      • New default sizes for statement cache
      • Renaming of @prisma/sdk npm package to @prisma/internals
      • Removal of the internal schema property from the generated Prisma Client

    extendedIndexes is now Generally Available

    Starting with this release, we're excited to announce that extendedIndexes is now Generally Available! πŸš€

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

    We introduced extendedIndexes in 3.5.0 and have constantly been shipping improvements in the subsequent releases to the configuration of indexes.

    ... (truncated)

    Commits
    • 6da1a84 chore: revert "fix(sdk): avoid crash in prisma version, rename 'getVersion' -...
    • fda0455 chore(deps): update engines to 3.16.0-49.da41d2bb3406da22087b849f0e911199ba4f...
    • ffb1ec4 chore(deps): update engines to 3.16.0-46.7913709f1e48160e65e366f365c239e3017a...
    • 7e7e804 internals: fixed spacing after 'Details:' (#14018)
    • c6951ec chore(deps): update engines to 3.16.0-45.e46a8f52bc07feff72927e42c1fa8bb4627d...
    • 3718bfa fix(sdk): avoid crash in prisma version, rename 'getVersion' -> 'getBinaryVer...
    • 8e90f8a feat(sdk): improved error reporting by adding detail to getConfig and getDmmf...
    • 5e4d9c2 chore(deps): update engines to 3.16.0-44.b49ece5df25d5e0d1d4b4e8935cc70745d76...
    • 8e9f510 chore(deps): update engines to 3.16.0-43.81a0ee489e5f8c8ce98440028ea905009243...
    • 857531a chore(deps): update engines to 3.16.0-42.7cd57f2ac6cbe3ad1b6126eb6814ebcefa85...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(v1.4.0)
Prisma 2+ generator to emit Joi schemas from your Prisma schema

Prisma Joi Generator Automatically generate Joi schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 26 Dec 24, 2022
Prisma +2 generator to emit a tRPC shield from your Prisma schema

Prisma tRPC Shield Generator Automatically generate a tRPC Shield from your Prisma Schema. Updates every time npx prisma generate runs. Table of Conte

Omar Dulaimi 27 Dec 24, 2022
Prisma 2+ generator to emit Zod schemas from your Prisma schema

Prisma Zod Generator Automatically generate Zod schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 212 Dec 27, 2022
A simple CLI to generate a starter schema for keystone-6 from a pre-existing prisma schema.

Prisma2Keystone A tool for converting prisma schema to keystone schema typescript This is a proof of concept. More work is needed Usage npx prisma2key

Brook Mezgebu 17 Dec 17, 2022
A NestJS module that allows you use Prisma, set up multiple Prisma services, and use multi-tenancy in each Prisma service.

NestJS Prisma Module Installation To use this package, first install it: npm i @sabinthedev/nestjs-prisma Basic Usage In order to use this package, yo

Sabin Adams 39 Dec 2, 2022
Gym Project to Learn ASP.NET Core

OneFitnessVue Gym Project to Learn ASP.NET Core. Read the Documentation » ⚑️ This is Sample Project Which Does not Contain All Features. ?? Buy Comple

Saineshwar Bageri 31 Jan 3, 2023
Using Htmx, ASP.NET Core, and Marten (postgres document db) to sort list

Using Htmx, ASP.NET Core, and Marten (postgres document db) to sort list

Khalid Abuhakmeh 5 Feb 16, 2022
The smallest CMS engine ever, made with ASP. NET Core and Dapper

TinyCMS The smallest CMS engine ever, made with ASP.NET Core and Dapper. Currently, only static content is supported, but adding new pages is as simpl

Marco Minerva 12 Dec 29, 2022
ASP.NET core, PostgreSQL

Technologies CityApp is built using the following technologies: Visual Studio 2017 ASP.NET Core (Targeting .net 4.61) SQL Server 2014/Azure SQL for da

Dredsoft 3 Sep 15, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Juan Daniel 5 Dec 15, 2022
A Feathers service adapter for Prisma ORM.

feathers-prisma A Feathers service adapter for Prisma ORM. Installation npm install feathers-prisma --save Documentation This adapter supports all me

Phil 27 Dec 9, 2022
Prisma is a next-generation object–relational mapper (ORM) that claims to help developers build faster and make fewer errors.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Rhodin Emmanuel Nagwere 1 Oct 8, 2022
A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo Β· Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Remix Stacks 18 Oct 31, 2022
Merge multiple Prisma schema files, model inheritance, resolving name conflicts and timings reports, all in a simple tool.

Prisma Util What is Prisma Util? β€’ How to use? β€’ The configuration file β€’ Support What is Prisma Util? Prisma Util is an easy to use tool that merges

David Hancu 21 Dec 28, 2022
This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io)

Alternative Prisma Data Proxy This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io). In order to deploy your project to

AijiUejima 60 Dec 28, 2022
A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil ?? A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Ben Smith 21 Jun 20, 2022
Serve file server with single zip file as file system in Deno.

zipland Serve file server with one-single zip file in Deno. Support zip just zip32 with deflated or uncompressed serving plaintext deflate Examples Yo

Yongwook Choi 18 Nov 2, 2022
Validate directory structure and file contents with an extension of JSON schema.

directory-schema-validator Description Validate directory structure and file contents with an extension of JSON schema. Install Install using NPM or s

Justin Poehnelt 5 Nov 1, 2022
Prisma 2+ generator to emit a JSON file that can be run with json-server

Prisma JSON Server Generator A Prisma generator that automates creating a JSON file that can be run as a server from your Prisma schema. Explore the o

Omar Dulaimi 14 Jan 7, 2023