Convex Seed

作者 get-convex2cfe645c87f9无许可证63 个星标收录于 2026年10月8日更新于 2026年10月8日仓库6天前更新

Seed or import data into the Convex database.

AI 生成的概览

通过 internalMutation 函数或 Convex 导入命令向 Convex 数据库填充或导入数据。

功能
该技能指导如何向 Convex 数据库表填充数据,方式包括编写可重复运行的 internalMutation 种子函数,或使用 Convex 批量导入命令。内容涵盖按 schema 调整数据格式、通过先清空再插入或 upsert 使填充具备幂等性,以及核对行数。它还给出规则,例如匹配校验器,以及绝不向共享部署填充密钥或个人身份信息。
适用场景
当 Convex 项目需要向数据表加载示例数据或批量数据时使用。适用于初始化、测试和环境准备等需要反复插入数据且不产生重复的场景。
运行要求
需要 Convex 项目以及可访问目标部署的 Convex CLI(npx convex run、npx convex import)。该技能不附带脚本,仅为操作说明。
<!-- GENERATED from convex-agents content/capabilities/seed.json — do not edit by hand. -->

Seed / import data

Populate tables via an internalMutation seed function (re-runnable) or npx convex import, matching the schema.

Workflow

  1. For fixtures: write an internalMutation that inserts sample rows; run it with npx convex run.
  2. For bulk import: shape the data to the schema and use npx convex import.
  3. Make seeding idempotent (clear-then-insert or upsert) so re-running is safe.
  4. Verify row counts.

Rules

  • Seed via internalMutation or convex import, matching validators.
  • Make seeding idempotent.
  • Never seed secrets/PII into a shared deployment.

来源与署名

来源:get-convex/agent-skills位于skills/convex-seed提交2cfe645

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架