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

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

The Ashby plugin syncs data locally. Use `corsair.ashby.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>

## Applications

Path: `ashby.db.applications.search`

```ts theme={null}
const rows = await corsair.ashby.db.applications.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 |
| `candidate_id`               | `string` | equals, contains, startsWith, endsWith, in |
| `job_id`                     | `string` | equals, contains, startsWith, endsWith, in |
| `status`                     | `string` | equals, contains, startsWith, endsWith, in |
| `current_interview_stage_id` | `string` | equals, contains, startsWith, endsWith, in |
| `archive_reason_id`          | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`                 | `date`   | equals, before, after, between             |
| `updated_at`                 | `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).*

***

## Candidates

Path: `ashby.db.candidates.search`

```ts theme={null}
const rows = await corsair.ashby.db.candidates.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 |
| `primary_email_address` | `string` | equals, contains, startsWith, endsWith, in |
| `primary_phone_number`  | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`            | `date`   | equals, before, after, between             |
| `updated_at`            | `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).*

***

## Departments

Path: `ashby.db.departments.search`

```ts theme={null}
const rows = await corsair.ashby.db.departments.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 |
| `parent_id`   | `string`  | equals, contains, startsWith, endsWith, in |
| `is_archived` | `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).*

***

## Job Postings

Path: `ashby.db.jobPostings.search`

```ts theme={null}
const rows = await corsair.ashby.db.jobPostings.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 |
| `title`          | `string`  | equals, contains, startsWith, endsWith, in |
| `job_id`         | `string`  | equals, contains, startsWith, endsWith, in |
| `department_id`  | `string`  | equals, contains, startsWith, endsWith, in |
| `location_id`    | `string`  | equals, contains, startsWith, endsWith, in |
| `is_listed`      | `boolean` | equals                                     |
| `published_date` | `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).*

***

## Jobs

Path: `ashby.db.jobs.search`

```ts theme={null}
const rows = await corsair.ashby.db.jobs.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 |
| `title`         | `string` | equals, contains, startsWith, endsWith, in |
| `status`        | `string` | equals, contains, startsWith, endsWith, in |
| `department_id` | `string` | equals, contains, startsWith, endsWith, in |
| `location_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`    | `date`   | equals, before, after, between             |
| `updated_at`    | `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).*

***

## Locations

Path: `ashby.db.locations.search`

```ts theme={null}
const rows = await corsair.ashby.db.locations.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 |
| `parent_id`   | `string`  | equals, contains, startsWith, endsWith, in |
| `is_archived` | `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).*

***

## Offers

Path: `ashby.db.offers.search`

```ts theme={null}
const rows = await corsair.ashby.db.offers.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 |
| `application_id` | `string` | equals, contains, startsWith, endsWith, in |
| `status`         | `string` | equals, contains, startsWith, endsWith, in |
| `salary`         | `number` | equals, gt, gte, lt, lte, in               |
| `currency`       | `string` | equals, contains, startsWith, endsWith, in |
| `start_date`     | `date`   | equals, before, after, between             |
| `created_at`     | `date`   | equals, before, after, between             |
| `updated_at`     | `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).*

***

## Users

Path: `ashby.db.users.search`

```ts theme={null}
const rows = await corsair.ashby.db.users.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 |
| `email`       | `string`  | equals, contains, startsWith, endsWith, in |
| `global_role` | `string`  | equals, contains, startsWith, endsWith, in |
| `is_enabled`  | `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).*

***
