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

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

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

## Comments

Path: `figma.db.comments.search`

```ts theme={null}
const rows = await corsair.figma.db.comments.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 |
| `uuid`        | `string` | equals, contains, startsWith, endsWith, in |
| `message`     | `string` | equals, contains, startsWith, endsWith, in |
| `file_key`    | `string` | equals, contains, startsWith, endsWith, in |
| `order_id`    | `string` | equals, contains, startsWith, endsWith, in |
| `parent_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`  | `string` | equals, contains, startsWith, endsWith, in |
| `resolved_at` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `date`   | equals, before, after, between             |
| `user_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `user_handle` | `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).*

***

## Components

Path: `figma.db.components.search`

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

### Searchable filters

| Field           | Type     | Operators                                  |
| --------------- | -------- | ------------------------------------------ |
| `entity_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `key`           | `string` | equals, contains, startsWith, endsWith, in |
| `file_key`      | `string` | equals, contains, startsWith, endsWith, in |
| `node_id`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`          | `string` | equals, contains, startsWith, endsWith, in |
| `description`   | `string` | equals, contains, startsWith, endsWith, in |
| `thumbnail_url` | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`    | `string` | equals, contains, startsWith, endsWith, in |
| `updated_at`    | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`     | `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).*

***

## File Metadata

Path: `figma.db.fileMetadata.search`

```ts theme={null}
const rows = await corsair.figma.db.fileMetadata.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 |
| `role`          | `string` | equals, contains, startsWith, endsWith, in |
| `last_modified` | `string` | equals, contains, startsWith, endsWith, in |
| `editorType`    | `string` | equals, contains, startsWith, endsWith, in |
| `thumbnail_url` | `string` | equals, contains, startsWith, endsWith, in |
| `version`       | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`     | `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).*

***

## Versions

Path: `figma.db.versions.search`

```ts theme={null}
const rows = await corsair.figma.db.versions.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 |
| `file_key`    | `string` | equals, contains, startsWith, endsWith, in |
| `label`       | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`  | `string` | equals, contains, startsWith, endsWith, in |
| `user_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `user_handle` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `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).*

***

## Webhook Configs

Path: `figma.db.webhookConfigs.search`

```ts theme={null}
const rows = await corsair.figma.db.webhookConfigs.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 |
| `team_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `endpoint`    | `string` | equals, contains, startsWith, endsWith, in |
| `passcode`    | `string` | equals, contains, startsWith, endsWith, in |
| `client_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `context_id`  | `string` | equals, contains, startsWith, endsWith, in |
| `event_type`  | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt`   | `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).*

***
