> ## 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

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

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

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

## Companies

Path: `clay.db.companies.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `clayCompanyId` | `number` | equals, gt, gte, lt, lte, in |
| `name` | `string` | equals, contains, startsWith, endsWith, in |
| `domain` | `string` | equals, contains, startsWith, endsWith, in |
| `size` | `string` | equals, contains, startsWith, endsWith, in |
| `industry` | `string` | equals, contains, startsWith, endsWith, in |
| `country` | `string` | equals, contains, startsWith, endsWith, in |
| `linkedinUrl` | `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).*

***

## People

Path: `clay.db.people.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `clayProfileId` | `number` | equals, gt, gte, lt, lte, in |
| `name` | `string` | equals, contains, startsWith, endsWith, in |
| `firstName` | `string` | equals, contains, startsWith, endsWith, in |
| `lastName` | `string` | equals, contains, startsWith, endsWith, in |
| `linkedinUrl` | `string` | equals, contains, startsWith, endsWith, in |
| `location` | `string` | equals, contains, startsWith, endsWith, in |
| `currentTitle` | `string` | equals, contains, startsWith, endsWith, in |
| `currentCompany` | `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).*

***

## Routine Runs

Path: `clay.db.routineRuns.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `routineRunId` | `string` | equals, contains, startsWith, endsWith, in |
| `routineId` | `string` | equals, contains, startsWith, endsWith, in |
| `status` | `string` | equals, contains, startsWith, endsWith, in |
| `total` | `number` | equals, gt, gte, lt, lte, in |
| `finished` | `number` | equals, gt, gte, lt, lte, in |
| `updatedAt` | `date` | equals, before, after, between |

*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).*

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.