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

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

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

## Clients

Path: `clientary.db.clients.search`

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

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `id`          | `number` | equals, gt, gte, lt, lte, in               |
| `name`        | `string` | equals, contains, startsWith, endsWith, in |
| `number`      | `string` | equals, contains, startsWith, endsWith, in |
| `city`        | `string` | equals, contains, startsWith, endsWith, in |
| `address`     | `string` | equals, contains, startsWith, endsWith, in |
| `address_2`   | `string` | equals, contains, startsWith, endsWith, in |
| `zip`         | `string` | equals, contains, startsWith, endsWith, in |
| `country`     | `string` | equals, contains, startsWith, endsWith, in |
| `state`       | `string` | equals, contains, startsWith, endsWith, in |
| `website`     | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `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).*

***

## Contacts

Path: `clientary.db.contacts.search`

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

### Searchable filters

| Field       | Type     | Operators                                  |
| ----------- | -------- | ------------------------------------------ |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id`        | `number` | equals, gt, gte, lt, lte, in               |
| `client_id` | `number` | equals, gt, gte, lt, lte, in               |
| `name`      | `string` | equals, contains, startsWith, endsWith, in |
| `email`     | `string` | equals, contains, startsWith, endsWith, in |
| `title`     | `string` | equals, contains, startsWith, endsWith, in |
| `phone`     | `string` | equals, contains, startsWith, endsWith, in |
| `mobile`    | `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).*

***

## Estimates

Path: `clientary.db.estimates.search`

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

### Searchable filters

| Field           | Type     | Operators                                  |
| --------------- | -------- | ------------------------------------------ |
| `entity_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `id`            | `number` | equals, gt, gte, lt, lte, in               |
| `number`        | `string` | equals, contains, startsWith, endsWith, in |
| `title`         | `string` | equals, contains, startsWith, endsWith, in |
| `date`          | `string` | equals, contains, startsWith, endsWith, in |
| `client_id`     | `number` | equals, gt, gte, lt, lte, in               |
| `status`        | `number` | equals, gt, gte, lt, lte, in               |
| `currency_code` | `string` | equals, contains, startsWith, endsWith, in |
| `subtotal`      | `number` | equals, gt, gte, lt, lte, in               |
| `total_cost`    | `number` | equals, gt, gte, lt, lte, in               |
| `tax`           | `number` | equals, gt, gte, lt, lte, 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).*

***

## Invoices

Path: `clientary.db.invoices.search`

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

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `id`             | `number` | equals, gt, gte, lt, lte, in               |
| `number`         | `string` | equals, contains, startsWith, endsWith, in |
| `title`          | `string` | equals, contains, startsWith, endsWith, in |
| `date`           | `string` | equals, contains, startsWith, endsWith, in |
| `due_date`       | `string` | equals, contains, startsWith, endsWith, in |
| `client_id`      | `number` | equals, gt, gte, lt, lte, in               |
| `status`         | `number` | equals, gt, gte, lt, lte, in               |
| `currency_code`  | `string` | equals, contains, startsWith, endsWith, in |
| `subtotal`       | `number` | equals, gt, gte, lt, lte, in               |
| `total_cost`     | `number` | equals, gt, gte, lt, lte, in               |
| `balance`        | `number` | equals, gt, gte, lt, lte, in               |
| `total_payments` | `number` | equals, gt, gte, lt, lte, 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).*

***

## Projects

Path: `clientary.db.projects.search`

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

### Searchable filters

| Field           | Type     | Operators                                  |
| --------------- | -------- | ------------------------------------------ |
| `entity_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `id`            | `number` | equals, gt, gte, lt, lte, in               |
| `name`          | `string` | equals, contains, startsWith, endsWith, in |
| `number`        | `string` | equals, contains, startsWith, endsWith, in |
| `description`   | `string` | equals, contains, startsWith, endsWith, in |
| `status`        | `number` | equals, gt, gte, lt, lte, in               |
| `budget_type`   | `number` | equals, gt, gte, lt, lte, in               |
| `project_type`  | `number` | equals, gt, gte, lt, lte, in               |
| `budget`        | `number` | equals, gt, gte, lt, lte, in               |
| `rate`          | `number` | equals, gt, gte, lt, lte, in               |
| `currency_code` | `string` | equals, contains, startsWith, endsWith, in |
| `start_date`    | `string` | equals, contains, startsWith, endsWith, in |
| `end_date`      | `string` | equals, contains, startsWith, endsWith, in |
| `client_id`     | `number` | equals, gt, gte, lt, lte, 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).*

***

## Tasks

Path: `clientary.db.tasks.search`

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

### Searchable filters

| Field         | Type      | Operators                                  |
| ------------- | --------- | ------------------------------------------ |
| `entity_id`   | `string`  | equals, contains, startsWith, endsWith, in |
| `id`          | `number`  | equals, gt, gte, lt, lte, in               |
| `client_id`   | `number`  | equals, gt, gte, lt, lte, in               |
| `project_id`  | `number`  | equals, gt, gte, lt, lte, in               |
| `user_id`     | `number`  | equals, gt, gte, lt, lte, in               |
| `assignee_id` | `number`  | equals, gt, gte, lt, lte, in               |
| `title`       | `string`  | equals, contains, startsWith, endsWith, in |
| `description` | `string`  | equals, contains, startsWith, endsWith, in |
| `complete`    | `boolean` | equals                                     |
| `due_date`    | `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).*

***
