convex-seed
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- GENERATED from convex-agents content/capabilities/seed.json — do not edit by hand. -->
<!-- 由 convex-agents content/capabilities/seed.json 生成 — 请勿手动编辑。 -->
Seed / import data
植入/导入数据
Populate tables via an internalMutation seed function (re-runnable) or , matching the schema.
npx convex import通过可重复运行的internalMutation种子函数或工具填充数据表,需匹配数据库架构。
npx convex importWorkflow
工作流程
- For fixtures: write an internalMutation that inserts sample rows; run it with .
npx convex run - For bulk import: shape the data to the schema and use .
npx convex import - Make seeding idempotent (clear-then-insert or upsert) so re-running is safe.
- Verify row counts.
- 对于测试数据:编写一个插入示例行的internalMutation;使用运行它。
npx convex run - 对于批量导入:调整数据格式以匹配架构,然后使用工具。
npx convex import - 确保植入操作具有幂等性(先清除再插入或更新插入),以便重复运行时是安全的。
- 验证行数。
Rules
规则
- Seed via internalMutation or convex import, matching validators.
- Make seeding idempotent.
- Never seed secrets/PII into a shared deployment.
- 通过internalMutation或convex import进行数据植入,需匹配验证器要求。
- 确保植入操作具有幂等性。
- 切勿将机密信息/个人可识别信息(PII)植入到共享部署环境中。