prisma-postgres
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrisma Postgres
Prisma Postgres
Guidance for creating, managing, and integrating Prisma Postgres across interactive and programmatic workflows.
本指南介绍如何在交互式与程序化工作流中创建、管理和集成Prisma Postgres。
When to Apply
适用场景
Reference this skill when:
- Setting up Prisma Postgres from Prisma Console
- Provisioning instant temporary databases with
create-db - Managing Prisma Postgres resources via Management API
- Using in TypeScript/JavaScript
@prisma/management-api-sdk - Handling claim URLs, connection strings, regions, and auth flows
以下场景可参考本技能:
- 从Prisma Console设置Prisma Postgres
- 使用配置即时临时数据库
create-db - 通过Management API管理Prisma Postgres资源
- 在TypeScript/JavaScript中使用
@prisma/management-api-sdk - 处理申领URL、连接字符串、区域及认证流程
Rule Categories by Priority
按优先级划分的规则类别
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | CLI Provisioning | CRITICAL | |
| 2 | Management API | CRITICAL | |
| 3 | Management API SDK | HIGH | |
| 4 | Console and Connections | HIGH | |
| 优先级 | 类别 | 影响级别 | 前缀 |
|---|---|---|---|
| 1 | CLI资源配置 | 关键 | |
| 2 | Management API | 关键 | |
| 3 | Management API SDK | 高 | |
| 4 | Console与连接 | 高 | |
Quick Reference
快速参考
- - instant databases and CLI options
create-db-cli - - service token and OAuth API workflows
management-api - - typed SDK usage with token storage
management-api-sdk - - Console operations and connection setup
console-and-connections
- - 即时数据库与CLI选项
create-db-cli - - 服务令牌与OAuth API工作流
management-api - - 带令牌存储的类型化SDK使用方法
management-api-sdk - - Console操作与连接设置
console-and-connections
Core Workflows
核心工作流
1. Console-first workflow
1. 以Console为主的工作流
Use Prisma Console for manual setup and operations:
- Open
https://console.prisma.io - Create/select workspace and project
- Use Studio in the project sidebar to view/edit data
- Retrieve direct connection details from the project UI
使用Prisma Console进行手动设置与操作:
- 打开
https://console.prisma.io - 创建/选择工作区与项目
- 使用项目侧边栏的Studio查看/编辑数据
- 从项目界面获取直接连接详情
2. Quick provisioning with create-db
2. 使用create-db快速配置
Use when you need a database immediately:
create-dbbash
npx create-db@latestAliases:
bash
npx create-pg@latest
npx create-postgres@latestFor app integrations, you can also use the programmatic API ( / ) from the npm package.
create()regions()create-dbTemporary databases auto-delete after ~24 hours unless claimed.
当您需要立即创建数据库时,使用:
create-dbbash
npx create-db@latest别名:
bash
npx create-pg@latest
npx create-postgres@latest对于应用集成,您还可以使用 npm包中的程序化API( / )。
create-dbcreate()regions()临时数据库若未被申领,将在约24小时后自动删除。
3. Programmatic provisioning with Management API
3. 使用Management API进行程序化配置
Use API endpoints on:
text
https://api.prisma.io/v1Explore the schema and endpoints using:
- OpenAPI docs:
https://api.prisma.io/v1/doc - Swagger Editor:
https://api.prisma.io/v1/swagger-editor
Auth options:
- Service token (workspace server-to-server)
- OAuth 2.0 (act on behalf of users)
使用以下地址的API端点:
text
https://api.prisma.io/v1可通过以下方式查看架构与端点:
- OpenAPI文档:
https://api.prisma.io/v1/doc - Swagger编辑器:
https://api.prisma.io/v1/swagger-editor
认证选项:
- 服务令牌(工作区服务器到服务器)
- OAuth 2.0(代表用户操作)
4. Type-safe integration with Management API SDK
4. 使用Management API SDK实现类型安全集成
Install and use:
bash
npm install @prisma/management-api-sdkUse for existing tokens, or for OAuth + token refresh.
createManagementApiClientcreateManagementApiSdk安装与使用:
bash
npm install @prisma/management-api-sdk对于现有令牌,使用;若需OAuth+令牌刷新,使用。
createManagementApiClientcreateManagementApiSdkRule Files
规则文件
Detailed guidance lives in:
references/console-and-connections.md
references/create-db-cli.md
references/management-api.md
references/management-api-sdk.md详细指南位于:
references/console-and-connections.md
references/create-db-cli.md
references/management-api.md
references/management-api-sdk.mdHow to Use
使用方法
Start with for fast setup, then switch to or when you need programmatic provisioning.
references/create-db-cli.mdreferences/management-api.mdreferences/management-api-sdk.md快速设置可从开始,当需要程序化配置时,再切换到或。
references/create-db-cli.mdreferences/management-api.mdreferences/management-api-sdk.md