入门
快速开始
¥Quickstart
要使用 Prisma Postgres 数据库引导新的 Prisma ORM 项目,请在终端中运行以下命令:
¥To bootstrap a new Prisma ORM project with a Prisma Postgres database, run the following command in your terminal:
npx prisma init --db
运行此命令后,终端将引导你完成后续步骤。按照 此页面 完成你的第一个 Prisma Postgres 项目的设置。
¥After running this command, the terminal will guide you with next steps. Follow this page to complete the setup for your first Prisma Postgres project.
如果你需要快速获取一个数据库进行测试,或者想试用 Prisma Postgres,可以运行以下命令来启动一个临时的 24 小时数据库:
¥If you need a database quickly for testing, or want to try out Prisma Postgres, you can run the following command to spin up a temporary 24-hour database:
npx create-db@latest
你可以在 专用文档 中了解有关 npx create-db 的更多信息。
¥You can learn more about npx create-db in the dedicated documentation.
Prisma ORM
Prisma Postgres 最简单的入门方法是遵循以下指南:
¥The easiest ways to get started with Prisma Postgres is by following these guides:
如果你想在全栈项目中探索 Prisma Postgres,请查看以下资源:
¥If you are looking to explore Prisma Postgres in a fullstack project, check out these resources:
-
Next.js 15 示例应用(包括身份验证)
¥Next.js 15 example app (including authentication)
通过任何数据库库/工具连接
¥Connect via any database library / tool
你可以使用任何你选择的 ORM 或数据库工具访问 Prisma Postgres。获得连接字符串后,你可以按照任何 ORM 或数据库工具的 PostgreSQL 设置文档进行操作:
¥You can access Prisma Postgres with any ORM or database tool of your choice. Once you have the connection string, you can follow the setup docs for PostgreSQL of any ORM or database tool:
在这个部分
¥In this section
你可以从一个全新的 Prisma Postgres 项目开始,或者将数据从现有数据库导入到 Prisma Postgres。
¥You can either start with a fresh Prisma Postgres project or import data from an existing database to Prisma Postgres.