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

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

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

## Contact Fields

Path: `mailtrap.db.contactFields.search`

```ts theme={null}
const rows = await corsair.mailtrap.db.contactFields.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 |
| `merge_tag` | `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).*

***

## Contact Lists

Path: `mailtrap.db.contactLists.search`

```ts theme={null}
const rows = await corsair.mailtrap.db.contactLists.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 |

*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: `mailtrap.db.contacts.search`

```ts theme={null}
const rows = await corsair.mailtrap.db.contacts.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 |
| `email`      | `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).*

***

## Email Templates

Path: `mailtrap.db.emailTemplates.search`

```ts theme={null}
const rows = await corsair.mailtrap.db.emailTemplates.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               |
| `uuid`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`       | `string` | equals, contains, startsWith, endsWith, in |
| `subject`    | `string` | equals, contains, startsWith, endsWith, in |
| `category`   | `string` | equals, contains, startsWith, endsWith, in |
| `body_html`  | `string` | equals, contains, startsWith, endsWith, in |
| `body_text`  | `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).*

***

## Inboxes

Path: `mailtrap.db.inboxes.search`

```ts theme={null}
const rows = await corsair.mailtrap.db.inboxes.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 |
| `status`              | `string` | equals, contains, startsWith, endsWith, in |
| `email_username`      | `string` | equals, contains, startsWith, endsWith, in |
| `project_id`          | `number` | equals, gt, gte, lt, lte, in               |
| `domain`              | `string` | equals, contains, startsWith, endsWith, in |
| `sent_messages_count` | `number` | equals, gt, gte, lt, lte, in               |
| `emails_count`        | `number` | equals, gt, gte, lt, lte, in               |
| `emails_unread_count` | `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: `mailtrap.db.projects.search`

```ts theme={null}
const rows = await corsair.mailtrap.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 |

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

***

## Sending Domains

Path: `mailtrap.db.sendingDomains.search`

```ts theme={null}
const rows = await corsair.mailtrap.db.sendingDomains.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               |
| `domain_name`            | `string`  | equals, contains, startsWith, endsWith, in |
| `demo`                   | `boolean` | equals                                     |
| `inbound_enabled`        | `boolean` | equals                                     |
| `inbound_verified`       | `boolean` | equals                                     |
| `open_tracking_enabled`  | `boolean` | equals                                     |
| `click_tracking_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).*

***
