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

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

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

## Apps

Path: `witai.db.apps.search`

```ts theme={null}
const rows = await corsair.witai.db.apps.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 |
| `lang`                        | `string` | equals, contains, startsWith, endsWith, in |
| `timezone`                    | `string` | equals, contains, startsWith, endsWith, in |
| `desc`                        | `string` | equals, contains, startsWith, endsWith, in |
| `will_train_at`               | `string` | equals, contains, startsWith, endsWith, in |
| `last_trained_at`             | `string` | equals, contains, startsWith, endsWith, in |
| `last_training_duration_secs` | `number` | equals, gt, gte, lt, lte, in               |
| `training_status`             | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`                  | `string` | equals, contains, startsWith, endsWith, in |
| `updated_at`                  | `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).*

***

## Entities

Path: `witai.db.entities.search`

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

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

***

## Intents

Path: `witai.db.intents.search`

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

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

***

## Tags

Path: `witai.db.tags.search`

```ts theme={null}
const rows = await corsair.witai.db.tags.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 |
| `desc`       | `string` | equals, contains, startsWith, endsWith, in |
| `created_at` | `string` | equals, contains, startsWith, endsWith, in |
| `updated_at` | `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).*

***

## Traits

Path: `witai.db.traits.search`

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

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

***

## Utterances

Path: `witai.db.utterances.search`

```ts theme={null}
const rows = await corsair.witai.db.utterances.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 |
| `text`      | `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).*

***

## Voices

Path: `witai.db.voices.search`

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

### Searchable filters

| Field       | Type     | Operators                                  |
| ----------- | -------- | ------------------------------------------ |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `name`      | `string` | equals, contains, startsWith, endsWith, in |
| `locale`    | `string` | equals, contains, startsWith, endsWith, in |
| `gender`    | `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).*

***
