Big Import and Export Improvements
When we released ZIP file imports and exports in Convex 1.7, it wasn't long before industrious developers started hitting the limitations. We’ve got some big improvements for you.
- File storage can now be included in Snapshot Export
- Snapshot import via
npx convex import
can now import file storage as well- Snapshot import is still atomic and preserves
_id
and_creationTime
, including for file storage.
- Snapshot import is still atomic and preserves
npx convex import
used to do a single HTTP request under the hood, which would time out for imports over 10MB. Every step of the import has been revamped so you can import gigabytes of documents and files, watching progress messages as it goes.
- You can now use
npx convex import --preview-name
to seed data in Preview deployments.
Debugging Improvements
console.time()
(MDN docs) is now supported, for measuring how long things take in queries, mutations, actions and HTTP actions.
export const someAction = action({
args: {},
handler: async (ctx) => {
console.time();
const results = await ctx.runQuery(internal.someQuery, {});
console.timeEnd(); // will log how long it took to run the query
// timers can have names and be nested
console.time("total time");
await ctx.runMutation(internal.mutation1, {});
console.time("mutation2 time");
await ctx.runMutation(internal.mutation2, {});
console.timeEnd("mutation2 time");
console.timeEnd("total time");
},
});
npx convex logs --history
now supports printing past logs. A number can be passed in to limit the number of most recent logs shown. All printed logs now include timestamps.
Additional changes
- In the dashboard, when adding new documents to a table, existing schema is used to suggest document fields
- Auth config now supports both
.ts
and.js
file extension (so eitherconvex/auth.config.ts
orconvex/auth.config.js
works) - Breaking change: when creating a preview deployment with
npx convex deploy
and a custom name (not inferred from Vercel or Netlify), the flag--preview-name
has been renamed to--preview-create