[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-896":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":45,"readmeContent":46,"aiSummary":47,"trendingCount":15,"starSnapshotCount":15,"syncStatus":48,"lastSyncTime":49,"discoverSource":50},896,"prisma","prisma\u002Fprisma","Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB","https:\u002F\u002Fwww.prisma.io",null,"TypeScript",46239,2240,339,2440,0,3,197,345,40,106,"Apache License 2.0",false,"main",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,5,39,40,41,42,43,44],"cockroachdb","database","javascript","mariadb","mongo","mongodb","mongodb-orm","mssql","mysql","nodejs","orm","postgres","postgresql","prisma-client","query-builder","sql-server","sqlite","sqlserver","typescript","2026-06-11 04:00:34","![Prisma](https:\u002F\u002Fi.imgur.com\u002Fh6UIYTu.png)\n\n\u003Cdiv align=\"center\">\n  \u003Ch1>Prisma\u003C\u002Fh1>\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fprisma\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fprisma.svg?style=flat\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fmain\u002FCONTRIBUTING.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPRs-welcome-brightgreen.svg\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202-blue\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpris.ly\u002Fdiscord\">\u003Cimg alt=\"Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F937751382725886062?label=Discord\">\u003C\u002Fa>\n  \u003Cbr \u002F>\n  \u003Cbr \u002F>\n  \u003Ca href=\"https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fgetting-started\u002Fprisma-orm\u002Fquickstart\u002Fprisma-postgres\">Quickstart\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fwww.prisma.io\u002F\">Website\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002F\">Docs\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-examples\u002F\">Examples\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fwww.prisma.io\u002Fblog\">Blog\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fpris.ly\u002Fdiscord?utm_source=github&utm_medium=prisma&utm_content=repo_readme\">Discord\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fpris.ly\u002Fx?utm_source=github&utm_medium=prisma&utm_content=repo_readme\">Twitter\u003C\u002Fa>\n  \u003Cspan>&nbsp;&nbsp;•&nbsp;&nbsp;\u003C\u002Fspan>\n  \u003Ca href=\"https:\u002F\u002Fpris.ly\u002Fyoutube?utm_source=github&utm_medium=prisma&utm_content=repo_readme\">Youtube\u003C\u002Fa>\n  \u003Cbr \u002F>\n  \u003Chr \u002F>\n\u003C\u002Fdiv>\n\n## What is Prisma?\n\nPrisma ORM is a **next-generation ORM** that consists of these tools:\n\n- [**Prisma Client**](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-client): Auto-generated and type-safe query builder for Node.js & TypeScript\n- [**Prisma Migrate**](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-migrate): Declarative data modeling & migration system\n- [**Prisma Studio**](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fstudio): GUI to view and edit data in your database\n\nPrisma Client can be used in _any_ Node.js or TypeScript backend application (including serverless applications and microservices). This can be a [REST API](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fconcepts\u002Foverview\u002Fprisma-in-your-stack\u002Frest), a [GraphQL API](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fconcepts\u002Foverview\u002Fprisma-in-your-stack\u002Fgraphql), a gRPC API, or anything else that needs a database.\n\n**If you need a database to use with Prisma ORM, check out [Prisma Postgres](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fgetting-started\u002Fprisma-orm\u002Fquickstart\u002Fprisma-postgres?utm_source=github&utm_medium=prisma-readme) or if you are looking for our MCP Server, head [here](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fmcp).**\n\n## Getting started\n\n### Quickstart (5min)\n\nThe fastest way to get started with Prisma is by following the quickstart guides. You can choose either of two databases:\n\n- [Prisma Postgres](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fgetting-started\u002Fprisma-orm\u002Fquickstart\u002Fprisma-postgres)\n- [SQLite](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fgetting-started\u002Fprisma-orm\u002Fquickstart\u002Fsqlite)\n\n### Bring your own database\n\nIf you already have your own database, you can follow these guides:\n\n- [Add Prisma to an existing project](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fgetting-started\u002Fprisma-orm\u002Fadd-to-existing-project\u002Fpostgresql)\n- [Set up a new project with Prisma from scratch](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fgetting-started\u002Fsetup-prisma\u002Fstart-from-scratch\u002Frelational-databases-typescript-postgresql)\n\n## How Prisma ORM works\n\nThis section provides a high-level overview of how Prisma ORM works and its most important technical components. For a more thorough introduction, visit the [Prisma documentation](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002F).\n\n### The Prisma schema\n\nEvery project that uses a tool from the Prisma toolkit starts with a [Prisma schema file](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema). The Prisma schema allows developers to define their _application models_ in an intuitive data modeling language and configure _generators_.\n\n```prisma\n\u002F\u002F Data source\ndatasource db {\n  provider = \"postgresql\"\n}\n\n\u002F\u002F Generator\ngenerator client {\n  provider = \"prisma-client\"\n  output   = \"..\u002Fgenerated\"\n}\n\n\u002F\u002F Data model\nmodel Post {\n  id        Int     @id @default(autoincrement())\n  title     String\n  content   String?\n  published Boolean @default(false)\n  author    User?   @relation(fields:  [authorId], references: [id])\n  authorId  Int?\n}\n\nmodel User {\n  id    Int     @id @default(autoincrement())\n  email String  @unique\n  name  String?\n  posts Post[]\n}\n```\n\nIn this schema, you configure three things:\n\n- **Data source**: Specifies your database type and thus defines the features and data types you can use in the schema\n- **Generator**: Indicates that you want to generate Prisma Client\n- **Data model**: Defines your application models\n\n### `prisma.config.ts`\n\nDatabase connection details are defined via [`prisma.config.ts`](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Fprisma-config-reference).\n\n```ts\nimport { defineConfig } from 'prisma\u002Fconfig'\n\nexport default defineConfig({\n  datasource: {\n    url: 'postgres:\u002F\u002F...',\n  },\n})\n```\n\nIf you store the database connection string in `process.env`, an `env` function can help you access it in a type safe way and throw an error if it is missing at run time:\n\n```ts\nimport { defineConfig, env } from 'prisma\u002Fconfig'\n\nexport default defineConfig({\n  datasource: {\n    url: env('DATABASE_URL'),\n  },\n})\n```\n\nPrisma ORM does not load the `.env` files for you automatically. If you want to populate the environment variables from a `.env` file, consider using a package such as [`dotenv`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fdotenv) or [`@dotenvx\u002Fdotenvx`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@dotenvx\u002Fdotenvx).\n\nThe configuration file may look like this in that case:\n\n```ts\nimport 'dotenv\u002Fconfig'\nimport { defineConfig, env } from 'prisma\u002Fconfig'\n\nexport default defineConfig({\n  datasource: {\n    url: env('DATABASE_URL'),\n  },\n})\n```\n\nTo start a local PostgreSQL development server without using Docker and without any configuration, run `prisma dev`:\n\n```sh\nnpx prisma dev\n```\n\nAlternatively, spin up an instant Prisma Postgres® database in the cloud:\n\n```sh\nnpx create-db --interactive\n```\n\n---\n\n### The Prisma data model\n\nOn this page, the focus is on the data model. You can learn more about [Data sources](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Foverview\u002Fdata-sources) and [Generators](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Foverview\u002Fgenerators) on the respective docs pages.\n\n#### Functions of Prisma models\n\nThe data model is a collection of [models](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Fdata-model\u002Fmodels). A model has two major functions:\n\n- Represent a table in the underlying database\n- Provide the foundation for the queries in the Prisma Client API\n\n#### Getting a data model\n\nThere are two major workflows for \"getting\" a data model into your Prisma schema:\n\n- Generate the data model from [introspecting](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-schema\u002Fintrospection) a database\n- Manually writing the data model and mapping it to the database with [Prisma Migrate](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-migrate)\n\nOnce the data model is defined, you can [generate Prisma Client](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-client\u002Fsetup-and-configuration\u002Fgenerating-prisma-client) which will expose CRUD and more queries for the defined models. If you're using TypeScript, you'll get full type-safety for all queries (even when only retrieving the subsets of a model's fields).\n\n---\n\n### Accessing your database with Prisma Client\n\n#### Step 1: Install Prisma\n\nFirst, install Prisma CLI as a development dependency and Prisma Client:\n\n```\nnpm install prisma --save-dev\nnpm install @prisma\u002Fclient\n```\n\n#### Step 2: Set up your Prisma schema\n\nEnsure your Prisma schema includes a `generator` block with an `output` path specified:\n\n```prisma\ngenerator client {\n  provider = \"prisma-client\"\n  output   = \"..\u002Fgenerated\"\n}\n\ndatasource db {\n  provider = \"postgresql\"  \u002F\u002F mysql, sqlite, sqlserver, mongodb or cockroachdb\n}\n```\n\n#### Step 3: Configure Prisma Config\n\nConfigure the Prisma CLI using a `prisma.config.ts` file. This file configures Prisma CLI subcommands like `migrate` and `studio`. Create a `prisma.config.ts` file in your project root:\n\n```ts\nimport { defineConfig, env } from 'prisma\u002Fconfig'\n\ntype Env = {\n  DATABASE_URL: string\n}\n\nexport default defineConfig({\n  schema: 'prisma\u002Fschema.prisma',\n  migrations: {\n    path: 'prisma\u002Fmigrations',\n  },\n  datasource: {\n    url: env\u003CEnv>('DATABASE_URL'),\n  },\n})\n```\n\n**Note**: Environment variables from `.env` files are not automatically loaded when using `prisma.config.ts`. You can use `dotenv` by importing `dotenv\u002Fconfig` at the top of your config file. For Bun, `.env` files are automatically loaded.\n\nLearn more about [Prisma Config](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Freference\u002Fprisma-config-reference) and all available configuration options.\n\n#### Step 4: Generate Prisma Client\n\nGenerate Prisma Client with the following command:\n\n```\nnpx prisma generate\n```\n\nThis command reads your Prisma schema and _generates_ the Prisma Client code in the location specified by the `output` path in your generator configuration.\n\nAfter you change your data model, you'll need to manually re-generate Prisma Client to ensure the generated code gets updated:\n\n```\nnpx prisma generate\n```\n\nRefer to the documentation for more information about [\"generating the Prisma client\"](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-client\u002Fsetup-and-configuration\u002Fgenerating-prisma-client).\n\n#### Step 5: Use Prisma Client to send queries to your database\n\nOnce the Prisma Client is generated, you can import it in your code and send queries to your database.\n\n##### Import and instantiate Prisma Client\n\nYou can import and instantiate Prisma Client from the output path specified in your generator configuration. When instantiating the Client, you need to provide a [driver adapter](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fcore-concepts\u002Fsupported-databases\u002Fdatabase-drivers#how-to-use-driver-adapters) to its constructor. For example, when using PostgreSQL with a driver adapter:\n\n```ts\nimport { PrismaClient } from '.\u002Fgenerated\u002Fclient'\nimport { PrismaPg } from '@prisma\u002Fadapter-pg'\n\nconst adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })\nconst prisma = new PrismaClient({ adapter })\n```\n\nTo load environment variables, you can use `dotenv` by importing `dotenv\u002Fconfig`, use `tsx --env-file=.env`, `node --env-file=.env`, or Bun (which loads `.env` automatically).\n\nNow you can start sending queries via the generated Prisma Client API, here are a few sample queries. Note that all Prisma Client queries return _plain old JavaScript objects_.\n\nLearn more about the available operations in the [Prisma Client docs](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-client) or watch this [demo video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=LggrE5kJ75I&list=PLn2e1F9Rfr6k9PnR_figWOcSHgc_erDr5&index=4) (2 min).\n\n##### Retrieve all `User` records from the database\n\n```ts\nconst allUsers = await prisma.user.findMany()\n```\n\n##### Include the `posts` relation on each returned `User` object\n\n```ts\nconst allUsers = await prisma.user.findMany({\n  include: { posts: true },\n})\n```\n\n##### Filter all `Post` records that contain `\"prisma\"`\n\n```ts\nconst filteredPosts = await prisma.post.findMany({\n  where: {\n    OR: [{ title: { contains: 'prisma' } }, { content: { contains: 'prisma' } }],\n  },\n})\n```\n\n##### Create a new `User` and a new `Post` record in the same query\n\n```ts\nconst user = await prisma.user.create({\n  data: {\n    name: 'Alice',\n    email: 'alice@prisma.io',\n    posts: {\n      create: { title: 'Join us for Prisma Day 2021' },\n    },\n  },\n})\n```\n\n##### Update an existing `Post` record\n\n```ts\nconst post = await prisma.post.update({\n  where: { id: 42 },\n  data: { published: true },\n})\n```\n\n#### Usage with TypeScript\n\nNote that when using TypeScript, the result of this query will be _statically typed_ so that you can't accidentally access a property that doesn't exist (and any typos are caught at compile-time). Learn more about leveraging Prisma Client's generated types on the [Advanced usage of generated types](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Form\u002Fprisma-client\u002Ftype-safety\u002Foperating-against-partial-structures-of-model-types) page in the docs.\n\n## Community\n\nPrisma has a large and supportive [community](https:\u002F\u002Fwww.prisma.io\u002Fcommunity) of enthusiastic application developers. You can join us on [Discord](https:\u002F\u002Fpris.ly\u002Fdiscord) and here on [GitHub](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fdiscussions).\n\n## Badges\n\n[![Made with Prisma](https:\u002F\u002Fmade-with.prisma.io\u002Fdark.svg)](https:\u002F\u002Fprisma.io) [![Made with Prisma](https:\u002F\u002Fmade-with.prisma.io\u002Findigo.svg)](https:\u002F\u002Fprisma.io)\n\nBuilt something awesome with Prisma? 🌟 Show it off with these [badges](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fpresskit?tab=readme-ov-file#badges), perfect for your readme or website.\n\n```\n[![Made with Prisma](https:\u002F\u002Fmade-with.prisma.io\u002Fdark.svg)](https:\u002F\u002Fprisma.io)\n```\n\n```\n[![Made with Prisma](https:\u002F\u002Fmade-with.prisma.io\u002Findigo.svg)](https:\u002F\u002Fprisma.io)\n```\n\n## Security\n\nIf you have a security issue to report, please contact us at [security@prisma.io](mailto:security@prisma.io?subject=[GitHub]%20Prisma%202%20Security%20Report%20).\n\n## Support\n\n### Ask a question about Prisma\n\nYou can ask questions and initiate [discussions](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fdiscussions\u002F) about Prisma-related topics in the `prisma` repository on GitHub.\n\n👉 [**Ask a question**](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fdiscussions\u002Fnew)\n\n### Create a bug report for Prisma\n\nIf you see an error message or run into an issue, please make sure to create a bug report! You can find [best practices for creating bug reports](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fguides\u002Fother\u002Ftroubleshooting-orm\u002Fcreating-bug-reports) (like including additional debugging output) in the docs.\n\n👉 [**Create bug report**](https:\u002F\u002Fpris.ly\u002Fprisma-prisma-bug-report)\n\n### Submit a feature request\n\nIf Prisma currently doesn't have a certain feature, be sure to check out the [roadmap](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fmore\u002Froadmap) to see if this is already planned for the future.\n\nIf the feature on the roadmap is linked to a GitHub issue, please make sure to leave a 👍 reaction on the issue and ideally a comment with your thoughts about the feature!\n\n👉 [**Submit feature request**](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fissues\u002Fnew?assignees=&labels=&template=feature_request.md&title=)\n\n## Contributing\n\nRefer to our [contribution guidelines](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fmain\u002FCONTRIBUTING.md) and [Code of Conduct for contributors](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fblob\u002Fmain\u002FCODE_OF_CONDUCT.md).\n\n## Tests Status\n\n- Prisma Tests Status:\n  [![Prisma Tests Status](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Fworkflows\u002FCI\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma\u002Factions\u002Fworkflows\u002Ftest.yml?query=branch%3Amain)\n- Ecosystem Tests Status:\n  [![Ecosystem Tests Status](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fecosystem-tests\u002Fworkflows\u002Ftest\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fprisma\u002Fecosystem-tests\u002Factions\u002Fworkflows\u002Ftest.yaml?query=branch%3Adev)\n","Prisma 是一个面向 Node.js 和 TypeScript 的下一代 ORM，支持包括 PostgreSQL、MySQL、MariaDB、SQL Server、SQLite、MongoDB 和 CockroachDB 在内的多种数据库。其核心功能包括自动生成且类型安全的 Prisma Client 查询构建器、声明式数据建模与迁移系统 Prisma Migrate 以及用于查看和编辑数据库数据的图形界面工具 Prisma Studio。Prisma 非常适合需要高效、类型安全地访问数据库的应用场景，无论是 REST API、GraphQL API 还是 gRPC 服务等后端应用都能从中受益。",2,"2026-06-11 02:40:06","top_all"]