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 從公開儲存庫中收錄這些內容。

檢舉或申請下架