Home / Companies / Convex / Blog / Post Details
Content Deep Dive

Seeding Data for Preview Deployments

Blog post from Convex

Post Details
Company
Date Published
Author
Ian Macartney
Word Count
1,367
Language
English
Hacker News Points
-
Summary

Ian Macartney's post explores various methods for seeding data in preview deployments, which involve populating a new database instance when beginning a project or testing backend changes. He discusses three primary approaches: manual entry through a dashboard, importing data via the CLI, and coding data seeding directly into the project. Each method has its pros and cons, such as the simplicity of manual entry, the efficiency of CLI imports, and the adaptability and reusability of coding data in alignment with current database schemas. Macartney expresses a preference for the coding approach, as it allows for type-checking against the schema, reusing code paths, and supporting complex data structures. He highlights using internal mutations to safely manage data seeding without exposing the process to public clients. The guide emphasizes the importance of maintaining up-to-date seed scripts to prevent data from becoming out of sync with schema changes and encourages the use of Convex's built-in features to streamline the development process.