> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Cursor local sync: searchable entities, `.search()` filters, and operators.

The Cursor plugin syncs data locally. Use `corsair.cursor.db.<entity>.search({ data, limit?, offset? })` with the filters listed per entity.

<Info>
  **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy).
</Info>

## Agents

Path: `cursor.db.agents.search`

```ts theme={null}
const rows = await corsair.cursor.db.agents.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field                | Type      | Operators                                  |
| -------------------- | --------- | ------------------------------------------ |
| `entity_id`          | `string`  | equals, contains, startsWith, endsWith, in |
| `id`                 | `string`  | equals, contains, startsWith, endsWith, in |
| `name`               | `string`  | equals, contains, startsWith, endsWith, in |
| `summary`            | `string`  | equals, contains, startsWith, endsWith, in |
| `createdAt`          | `date`    | equals, before, after, between             |
| `sourceRef`          | `string`  | equals, contains, startsWith, endsWith, in |
| `sourceRepository`   | `string`  | equals, contains, startsWith, endsWith, in |
| `targetUrl`          | `string`  | equals, contains, startsWith, endsWith, in |
| `targetPrUrl`        | `string`  | equals, contains, startsWith, endsWith, in |
| `targetBranchName`   | `string`  | equals, contains, startsWith, endsWith, in |
| `targetAutoCreatePr` | `boolean` | equals                                     |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Api Keys

Path: `cursor.db.apiKeys.search`

```ts theme={null}
const rows = await corsair.cursor.db.apiKeys.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field        | Type     | Operators                                  |
| ------------ | -------- | ------------------------------------------ |
| `entity_id`  | `string` | equals, contains, startsWith, endsWith, in |
| `id`         | `string` | equals, contains, startsWith, endsWith, in |
| `apiKeyName` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`  | `date`   | equals, before, after, between             |
| `userEmail`  | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Models

Path: `cursor.db.models.search`

```ts theme={null}
const rows = await corsair.cursor.db.models.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field       | Type     | Operators                                  |
| ----------- | -------- | ------------------------------------------ |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id`        | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Repositories

Path: `cursor.db.repositories.search`

```ts theme={null}
const rows = await corsair.cursor.db.repositories.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field        | Type     | Operators                                  |
| ------------ | -------- | ------------------------------------------ |
| `entity_id`  | `string` | equals, contains, startsWith, endsWith, in |
| `id`         | `string` | equals, contains, startsWith, endsWith, in |
| `name`       | `string` | equals, contains, startsWith, endsWith, in |
| `owner`      | `string` | equals, contains, startsWith, endsWith, in |
| `repository` | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***
