Importing Static Content
Hey gang, my app has some fixed sets of entities (category types, feature flags etc) and static content (just text with an ID). I have build scripts that collect everything and spit out JSON that I've been importing into tables via CLI. For prod though the CLI isn't available, so the options seem to be clearing the table and manually importing JSON in the control panel? Or is there a better way to implement this? Totally fine if this is a manual step rather than part of CI/CD, and I don't need to preserve any _id relationships. Any ideas?
2 Replies
You can run the same scripts in CI and use the CLI with
--prod
- does that work?
@prtcl holler if you have different needs than from the CLI. You can also import JSON in your convex bundle, but then it requires a deploy to change it, and it adds to your convex function bundle size (not sure how big this file is). Or write a function that you can call with npx convex run
passing up the JSON. tons of options, but CLI overall should be available to youthanks @ian ! the --prod flag definitely works, didn't see that in the docs and was a bit confused about the wording which sounded like the CLI was mainly intended for dev tasks. think I'll keep this as a manual step for now instead of CI/CD since the content updates aren't 100% tied to code or schema
for feature flags I did end up creating an internal migration which upserts new flags with a false value but leaves existing as-is