---
title: "Data, files and jobs"
description: "Read and write live Convex data from Vue and Nitro, search and count it, store files, and run durable workflows and migrations."
canonical_url: "https://nuxt-backend.dev/docs/data"
---
# Data, files and jobs

> Read and write live Convex data from Vue and Nitro, search and count it, store files, and run durable workflows and migrations.

Your app's data lives in Convex tables you define in your own schema, `backend/schema.ts`. This section covers the tools that work on those tables: live queries and mutations in Vue, server calls and preloading in Nitro, full-text search, counts and sums, file uploads, durable workflows and online migrations. Each one is a thin helper over Convex itself, or over a Convex component the scaffold already mounts.

## What the component owns

The `backend` component keeps tables of its own: the Better Auth tables, the billing and credit cache, gift purchases, the AI request records and the webhook delivery log. You reach those through the package's functions and composables, not through your schema. Everything else is yours: your tables, your functions, and the data the bundled workflow, migrations and aggregate components work over. [How it works](https://nuxt-backend.dev/docs/start/concepts/how-it-works#what-one-call-mounts) maps each capability to its component.

## Which tool to use

<table>
<thead>
  <tr>
    <th>
      You want to
    </th>
    
    <th>
      Use
    </th>
    
    <th>
      Page
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Show data that updates live
    </td>
    
    <td>
      A query, read with <code>
        useQuery
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/queries-and-mutations">
        Queries & mutations
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Write data, with an optimistic update if you want one
    </td>
    
    <td>
      A mutation, called with <code>
        useMutation
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/queries-and-mutations#usemutation">
        Queries & mutations
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Call an outside API or a model
    </td>
    
    <td>
      An action, called with <code>
        useAction
      </code>
      
      , or a <a href="https://nuxt-backend.dev/docs/ai/metered-actions">
        metered action
      </a>
      
       when it spends credits
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/queries-and-mutations#useaction">
        Queries & mutations
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Load a long list a page at a time
    </td>
    
    <td>
      <code>
        usePaginatedQuery
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/queries-and-mutations#pagination">
        Queries & mutations
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Call Convex from a Nitro route, or render data on the first load
    </td>
    
    <td>
      <code>
        fetchQuery
      </code>
      
      , <code>
        backendAuth(event)
      </code>
      
      , <code>
        preloadQuery
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/server-rendering">
        Server & SSR
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Show why a call was refused, or refuse one yourself
    </td>
    
    <td>
      <code>
        getBackendError
      </code>
      
      , <code>
        backendError
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/errors">
        Handle errors
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Find rows by the words in a text field
    </td>
    
    <td>
      <code>
        search
      </code>
      
      , <code>
        defineSearch
      </code>
      
      , <code>
        useSearch
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/search">
        Full-text search
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Show a count or a sum without reading every row
    </td>
    
    <td>
      <code>
        TableAggregate
      </code>
      
      , <code>
        useAggregate
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/aggregates">
        Aggregates
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Upload files and show them
    </td>
    
    <td>
      <code>
        useUpload
      </code>
      
      , <code>
        useUploadQueue
      </code>
      
      , <code>
        useStorageUrl
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/files">
        File storage
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Run steps over minutes or days that survive restarts
    </td>
    
    <td>
      <code>
        setupWorkflows
      </code>
      
      , <code>
        useWorkflowStatus
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/jobs/workflows">
        Workflows
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Change existing documents in batches, or backfill an aggregate
    </td>
    
    <td>
      <code>
        setupMigrations
      </code>
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/data/jobs/migrations">
        Migrations
      </a>
    </td>
  </tr>
</tbody>
</table>

## In this section

<card-group>
<card icon="i-lucide-zap" title="Queries & Mutations" to="https://nuxt-backend.dev/docs/data/queries-and-mutations">

Read live data with `useQuery`, write with `useMutation`, call actions, and paginate.

</card>

<card icon="i-lucide-server" title="Server & SSR" to="https://nuxt-backend.dev/docs/data/server-rendering">

Call Convex from Nitro handlers, as the signed-in user when needed, and preload queries for hydration.

</card>

<card icon="i-lucide-octagon-alert" title="Handle errors" to="https://nuxt-backend.dev/docs/data/errors">

Read a refusal's stable code on the client, and refuse from your own functions with the same codes.

</card>

<card icon="i-lucide-search" title="Full-Text Search" to="https://nuxt-backend.dev/docs/data/search">

Search a table's text with a builder checked against your schema, and drive it from an input with `useSearch`.

</card>

<card icon="i-lucide-sigma" title="Aggregates" to="https://nuxt-backend.dev/docs/data/aggregates">

Keep counts and sums in sync through triggers, and read them live with `useAggregate`.

</card>
</card-group>

## Files

<card-group>
<card icon="i-lucide-upload" title="File Storage" to="https://nuxt-backend.dev/docs/data/files">

Upload one file or a queue of them with progress and cancellation, then resolve the served URL.

</card>
</card-group>

## Background work

<card-group>
<card icon="i-lucide-workflow" title="Workflows" to="https://nuxt-backend.dev/docs/data/jobs/workflows">

Define durable multi-step functions and email sequences, and follow a run's status from Vue.

</card>

<card icon="i-lucide-arrow-right-left" title="Migrations" to="https://nuxt-backend.dev/docs/data/jobs/migrations">

Change existing documents in batches, dry-run first, and resume where a run stopped.

</card>
</card-group>

## Not covered here

- **The storage functions.** The upload helpers call a `generateUploadUrl` mutation and a `getUrl` query that you write in your backend; [File storage](https://nuxt-backend.dev/docs/data/files) shows both.
- **A workflow status query.** The scaffold ships none; [Workflows](https://nuxt-backend.dev/docs/data/jobs/workflows#reactive-status) shows the one `useWorkflowStatus` reads.

<page-keys>

- Try it live in the playground: [/playground/client/queries](https://nuxt-backend.dev/playground/client/queries)
- API reference: [/docs/reference/api/functions](https://nuxt-backend.dev/docs/reference/api/functions)
- Source: [https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/functions.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/functions.ts)

</page-keys>


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
