PackageTrack

npm · #3659 most downloaded on npm

@prisma/client

7.10.0prisma/prisma

Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.

Release timeline

10653 releases since 2020
20202026

One column per quarter.

Releases

  1. 5.8.0-dev.3919 Dec 2023pre-release

    Nothing published for this version

  2. 5.8.0-dev.3818 Dec 2023pre-release

    Nothing published for this version

  3. 5.8.0-dev.3716 Dec 2023pre-release

    Nothing published for this version

  4. 5.8.0-dev.3616 Dec 2023pre-release

    Nothing published for this version

  5. 5.8.0-dev.3516 Dec 2023pre-release

    Nothing published for this version

  6. 5.8.0-dev.3316 Dec 2023pre-release

    Nothing published for this version

  7. 5.8.0-dev.3215 Dec 2023pre-release

    Nothing published for this version

  8. 5.8.0-dev.3115 Dec 2023pre-release

    Nothing published for this version

  9. 5.8.0-dev.3015 Dec 2023pre-release

    Nothing published for this version

  10. 5.8.0-dev.2915 Dec 2023pre-release

    Nothing published for this version

  11. 5.8.0-dev.2815 Dec 2023pre-release

    Nothing published for this version

  12. 5.8.0-dev.2715 Dec 2023pre-release

    Nothing published for this version

  13. 5.8.0-dev.2615 Dec 2023pre-release

    Nothing published for this version

  14. 5.8.0-dev.2514 Dec 2023pre-release

    Nothing published for this version

  15. 5.8.0-dev.2413 Dec 2023pre-release

    Nothing published for this version

  16. 5.8.0-dev.2313 Dec 2023pre-release

    Nothing published for this version

  17. 5.8.0-dev.2213 Dec 2023pre-release

    Nothing published for this version

  18. 5.8.0-dev.2113 Dec 2023pre-release

    Nothing published for this version

  19. 5.8.0-dev.2013 Dec 2023pre-release

    Nothing published for this version

  20. 5.8.0-dev.1913 Dec 2023pre-release

    Nothing published for this version

  21. 5.8.0-dev.1813 Dec 2023pre-release

    Nothing published for this version

  22. 5.8.0-dev.1713 Dec 2023pre-release

    Nothing published for this version

  23. 5.8.0-dev.1613 Dec 2023pre-release

    Nothing published for this version

  24. 5.8.0-dev.1512 Dec 2023pre-release

    Nothing published for this version

  25. 5.8.0-dev.1412 Dec 2023pre-release

    Nothing published for this version

  26. 5.8.0-dev.1311 Dec 2023pre-release

    Nothing published for this version

  27. 5.8.0-dev.1211 Dec 2023pre-release

    Nothing published for this version

  28. 5.8.0-dev.1111 Dec 2023pre-release

    Nothing published for this version

  29. 5.8.0-dev.109 Dec 2023pre-release

    Nothing published for this version

  30. 5.8.0-dev.98 Dec 2023pre-release

    Nothing published for this version

  31. 5.8.0-dev.88 Dec 2023pre-release

    Nothing published for this version

  32. 5.8.0-dev.78 Dec 2023pre-release

    Nothing published for this version

  33. 5.8.0-dev.68 Dec 2023pre-release

    Nothing published for this version

  34. 5.8.0-dev.58 Dec 2023pre-release

    Nothing published for this version

  35. 5.8.0-dev.47 Dec 2023pre-release

    Nothing published for this version

  36. 5.8.0-dev.37 Dec 2023pre-release

    Nothing published for this version

  37. 5.8.0-dev.26 Dec 2023pre-release

    Nothing published for this version

  38. 5.8.0-dev.16 Dec 2023pre-release

    Nothing published for this version

  39. 5.7.118 Dec 2023
    Release notesOpen source →
  40. 5.7.1-dev.318 Dec 2023pre-release

    Nothing published for this version

  41. 5.7.1-dev.218 Dec 2023pre-release

    Nothing published for this version

  42. 5.7.1-dev.118 Dec 2023pre-release

    Nothing published for this version

  43. 5.7.06 Dec 2023
    Release notes

    🌟 Help us spread the word about Prisma by starring the repo or posting on X (formerly Twitter) about the release.

    Highlights

    ✨ In this release, we improved the SQL queries Prisma Client generates for you with two new Preview features, the driver adapters, and support for the database drivers we currently support. 5.7.0 will be the last release of the year. Stay tuned for the next one in January! ✨

    Preview support for JOINs for relation queries for PostgreSQL and CockroachDB

    We’re excited to announce Preview support for JOINs in Prisma Client when querying relations. Support for JOINs has been a long-standing feature request, and this release adds support for PostgreSQL and CockroachDB. The upcoming releases will expand support for other databases Prisma supports.

    To get started using JOINs, enable the Preview feature in your Prisma schema:

    // schema.prisma
    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["relationJoins"]
    }
    

    Run prisma generate to regenerate Prisma Client and enable the Preview feature.

    Prisma Client will use a JOIN in your query to fetch relation data for a majority of the cases.

    Example queries

    <details>

    <summary><b>1-1 relation queries example</b></summary>

    Prisma Client query

    await prisma.user.findUnique({
    	where: {
    		id: 1
    	},
    	include: {
    		profile: true
    	}
    })
    

    SQL

    SELECT
    	"t1"."id",
    	"t1"."name",
    	"User_profile"."__prisma_data__" AS "profile"
    FROM
    	"public"."User" AS "t1"
    	LEFT JOIN LATERAL (
    		SELECT
    			COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__"
    		FROM
    			(
    				SELECT
    					"t4"."__prisma_data__"
    				FROM
    					(
    						SELECT
    							JSON_BUILD_OBJECT(
    								'id',
    								"t3"."id",
    								'bio',
    								"t3"."bio",
    								'userId',
    								"t3"."userId"
    							) AS "__prisma_data__"
    						FROM
    							(
    								SELECT
    									"t2".*
    								FROM
    									"public"."Profile" AS "t2"
    								WHERE
    									"t1"."id" = "t2"."userId"
    							) AS "t3"
    					) AS "t4"
    			) AS "t5"
    	) AS "User_profile" ON TRUE
    WHERE "t1"."id" = $1
    LIMIT $2
    

    </details>

    <details>

    <summary><b>1-m relation queries example</b></summary>

    Prisma Client query

    await prisma.user.findUnique({
    	where: {
    		id: 1
    	},
    	include: {
    		posts: true
    	}
    })
    

    SQL

    SELECT
    	"t1"."id",
    	"t1"."name",
    	"User_posts"."__prisma_data__" AS "posts"
    FROM
    	"public"."User" AS "t1"
    	LEFT JOIN LATERAL (
    		SELECT
    			COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__"
    		FROM
    			(
    				SELECT
    					"t4"."__prisma_data__"
    				FROM
    					(
    						SELECT
    							JSON_BUILD_OBJECT(
    								'id',
    								"t3"."id",
    								'title',
    								"t3"."title",
    								'content',
    								"t3"."content",
    								'published',
    								"t3"."published",
    								'authorId',
    								"t3"."authorId"
    							) AS "__prisma_data__"
    						FROM
    							(
    								SELECT
    									"t2".*
    								FROM
    									"public"."Post" AS "t2"
    								WHERE
    									"t1"."id" = "t2"."authorId"
    									/* root select */
    							) AS "t3"
    							/* inner select */
    					) AS "t4"
    					/* middle select */
    			) AS "t5"
    			/* outer select */
    	) AS "User_posts" ON TRUE
    WHERE "t1"."id" = $1
    LIMIT $2
    

    </details>

    <details>

    <summary><b>m-n relation queries example</b></summary>

    Prisma Client query

    await prisma.post.findUnique({
    	where: {
    		id: 1
    	},
    	include: {
    		tags: true
    	}
    })
    

    SQL

    SELECT
    	"t1"."id",
    	"t1"."title",
    	"t1"."content",
    	"t1"."published",
    	"t1"."authorId",
    	"Post_tags_m2m"."__prisma_data__" AS "tags"
    FROM
    	"public"."Post" AS "t1"
    	LEFT JOIN LATERAL (
    		SELECT
    			COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__"
    		FROM
    			(
    				SELECT
    					"Post_tags"."__prisma_data__"
    				FROM
    					"public"."_PostToTag" AS "t2"
    					LEFT JOIN LATERAL (
    						SELECT
    							JSON_BUILD_OBJECT('id', "t4"."id", 'name', "t4"."name") AS "__prisma_data__",
    							"t4"."id"
    						FROM
    							(
    								SELECT
    									"t3".*
    								FROM
    									"public"."Tag" AS "t3"
    								WHERE
    									"t2"."B" = "t3"."id"
    									/* root select */
    							) AS "t4"
    					) AS "Post_tags" ON TRUE
    				WHERE
    					"t2"."A" = "t1"."id"
    			) AS "Post_tags_m2m_1"
    	) AS "Post_tags_m2m" ON TRUE
    WHERE "t1"."id" = $1
    LIMIT $2
    

    </details>

    Share your feedback and create a bug report if you encounter any issues.

    Prisma’s distinct option now uses SQL queries (Preview)

    From this release, Prisma Client’s distinct option now uses the native SQL DISTINCT ON for unordered queries with PostgreSQL and CockroachDB. The upcoming releases will expand support for the other databases that Prisma supports.

    Prisma Client already supports querying for distinct records. However, Prisma Client took care of the post-processing for distinct records in memory.

    To get started, enable the Preview feature in your Prisma schema:

    // schema.prisma
    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["nativeDistinct"]
    }
    

    Regenerate your Prisma Client to get started using the Preview feature.

    Given the following Prisma Client query:

    await prisma.user.findMany({
        distinct: ['role'],
        select: {
          role: true,
        },
    })
    

    Before 5.7.0

    Previously, Prisma Client handled the post-processing to select distinct records in-memory. Therefore, the following query was generated and executed against your database:

    SELECT
    	"public"."User"."id",
    	"public"."User"."role"::text
    FROM
    	"public"."User"
    WHERE
    	1 = 1 OFFSET $1
    

    After 5.7.0

    SELECT DISTINCT ON ("public"."User"."role")
    	"public"."User"."id",
    	"public"."User"."role"::text
    FROM
    	"public"."User"
    WHERE
    	1 = 1 OFFSET $1
    

    Share your feedback and create a bug report if you encounter any issues.

    Improved support for Netlify using Node.js v20

    In this release, we improved Prisma support when deploying to Netlify on Node.js v20. Previously, the Prisma Client could not resolve the location of the Query Engine after deploying to Netlify when using Node.js v20. If you run into this issue, we recommend updating to Prisma v5.7.0.

    We recommend giving this comment on GitHub a read if you are not yet able to upgrade Prisma, to learn how to get around the error.

    Fixes and improvements

    Prisma Client

    Prisma

    Prisma Migrate

    Credits

    Huge thanks to @anuraaga, @onichandame, @LucianBuzzo, @RobertCraigie, @fqazi, @KhooHaoYit, @alencardc, @Oreilles, @christianledgard, @skyzh, @alula, @AikoRamalho, @petradonka for helping!

    Company news

    💼 We’re hiring!

    If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.

    We're hiring for the following roles:

    Open source →
  44. 5.7.0-integration-wasm-0-0-9.127 Nov 2023pre-release

    Nothing published for this version

  45. 5.7.0-integration-wasm-0-0-8.125 Nov 2023pre-release

    Nothing published for this version

  46. 5.7.0-integration-test-client-wasm-engine.1929 Nov 2023pre-release

    Nothing published for this version

  47. 5.7.0-integration-test-client-wasm-engine.1829 Nov 2023pre-release

    Nothing published for this version

  48. 5.7.0-integration-test-client-wasm-engine.1729 Nov 2023pre-release

    Nothing published for this version

  49. 5.7.0-integration-test-client-wasm-engine.1629 Nov 2023pre-release

    Nothing published for this version

  50. 5.7.0-integration-test-client-wasm-engine.1529 Nov 2023pre-release

    Nothing published for this version

  51. 5.7.0-integration-test-client-wasm-engine.1428 Nov 2023pre-release

    Nothing published for this version

  52. 5.7.0-integration-test-client-wasm-engine.1328 Nov 2023pre-release

    Nothing published for this version

  53. 5.7.0-integration-test-client-wasm-engine.1228 Nov 2023pre-release

    Nothing published for this version

  54. 5.7.0-integration-test-client-wasm-engine.1128 Nov 2023pre-release

    Nothing published for this version

  55. 5.7.0-integration-test-client-wasm-engine.1028 Nov 2023pre-release

    Nothing published for this version

  56. 5.7.0-integration-test-client-wasm-engine.928 Nov 2023pre-release

    Nothing published for this version

  57. 5.7.0-integration-test-client-wasm-engine.828 Nov 2023pre-release

    Nothing published for this version

  58. 5.7.0-integration-test-client-wasm-engine.728 Nov 2023pre-release

    Nothing published for this version

  59. 5.7.0-integration-test-client-wasm-engine.628 Nov 2023pre-release

    Nothing published for this version

  60. 5.7.0-integration-test-client-wasm-engine.528 Nov 2023pre-release

    Nothing published for this version