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

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

The Toggl plugin syncs data locally. Use `corsair.toggl.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: `toggl.db.clients.search`

```ts theme={null}
const rows = await corsair.toggl.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               |
| `workspace_id` | `number`  | equals, gt, gte, lt, lte, in               |
| `name`         | `string`  | equals, contains, startsWith, endsWith, in |
| `archived`     | `boolean` | equals                                     |
| `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).*

***

## Projects

Path: `toggl.db.projects.search`

```ts theme={null}
const rows = await corsair.toggl.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               |
| `workspace_id` | `number`  | equals, gt, gte, lt, lte, in               |
| `client_id`    | `number`  | equals, gt, gte, lt, lte, in               |
| `name`         | `string`  | equals, contains, startsWith, endsWith, in |
| `active`       | `boolean` | equals                                     |
| `billable`     | `boolean` | equals                                     |
| `color`        | `string`  | equals, contains, startsWith, endsWith, in |
| `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).*

***

## Tags

Path: `toggl.db.tags.search`

```ts theme={null}
const rows = await corsair.toggl.db.tags.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               |
| `workspace_id` | `number` | equals, gt, gte, lt, lte, in               |
| `name`         | `string` | equals, contains, startsWith, endsWith, in |
| `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).*

***

## Workspaces

Path: `toggl.db.workspaces.search`

```ts theme={null}
const rows = await corsair.toggl.db.workspaces.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               |
| `organization_id`  | `number`  | equals, gt, gte, lt, lte, in               |
| `name`             | `string`  | equals, contains, startsWith, endsWith, in |
| `premium`          | `boolean` | equals                                     |
| `role`             | `string`  | equals, contains, startsWith, endsWith, in |
| `default_currency` | `string`  | equals, contains, startsWith, endsWith, in |
| `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).*

***
