neon-postgres
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNeon Postgres
Neon Postgres
Patterns
模式
Prisma with Neon Connection
Prisma与Neon连接配置
Configure Prisma for Neon with connection pooling.
Use two connection strings:
- DATABASE_URL: Pooled connection for Prisma Client
- DIRECT_URL: Direct connection for Prisma Migrate
The pooled connection uses PgBouncer for up to 10K connections.
Direct connection required for migrations (DDL operations).
配置Prisma以使用Neon的连接池。
使用两个连接字符串:
- DATABASE_URL:供Prisma Client使用的池化连接
- DIRECT_URL:供Prisma Migrate使用的直连
池化连接使用PgBouncer,支持最多10000个连接。
迁移(DDL操作)需要使用直连。
Drizzle with Neon Serverless Driver
Drizzle与Neon无服务器驱动
Use Drizzle ORM with Neon's serverless HTTP driver for
edge/serverless environments.
Two driver options:
- neon-http: Single queries over HTTP (fastest for one-off queries)
- neon-serverless: WebSocket for transactions and sessions
在边缘/无服务器环境中,搭配Neon的无服务器HTTP驱动使用Drizzle ORM。
两种驱动选项:
- neon-http:通过HTTP执行单次查询(单次查询速度最快)
- neon-serverless:用于事务和会话的WebSocket驱动
Connection Pooling with PgBouncer
基于PgBouncer的连接池
Neon provides built-in connection pooling via PgBouncer.
Key limits:
- Up to 10,000 concurrent connections to pooler
- Connections still consume underlying Postgres connections
- 7 connections reserved for Neon superuser
Use pooled endpoint for application, direct for migrations.
Neon通过PgBouncer提供内置的连接池功能。
关键限制:
- 池化器最多支持10000个并发连接
- 连接仍会占用底层Postgres连接
- 预留7个连接供Neon超级用户使用
应用使用池化端点,迁移使用直连。
⚠️ Sharp Edges
⚠️ 注意事项
| Issue | Severity | Solution |
|---|---|---|
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | high | See docs |
| Issue | medium | See docs |
| Issue | medium | See docs |
| Issue | low | See docs |
| Issue | medium | See docs |
| Issue | high | See docs |
| 问题 | 严重程度 | 解决方案 |
|---|---|---|
| 问题 | 高 | 查看文档 |
| 问题 | 高 | 查看文档 |
| 问题 | 高 | 查看文档 |
| 问题 | 中 | 查看文档 |
| 问题 | 中 | 查看文档 |
| 问题 | 低 | 查看文档 |
| 问题 | 中 | 查看文档 |
| 问题 | 高 | 查看文档 |