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

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

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

## Access Tokens

Path: `buildkite.db.accessTokens.search`

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

### Searchable filters

| Field         | Type     | Operators                                  |
| ------------- | -------- | ------------------------------------------ |
| `entity_id`   | `string` | equals, contains, startsWith, endsWith, in |
| `uuid`        | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`  | `string` | equals, contains, startsWith, endsWith, in |
| `expires_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).*

***

## Agents

Path: `buildkite.db.agents.search`

```ts theme={null}
const rows = await corsair.buildkite.db.agents.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 |
| `graphql_id`           | `string` | equals, contains, startsWith, endsWith, in |
| `url`                  | `string` | equals, contains, startsWith, endsWith, in |
| `web_url`              | `string` | equals, contains, startsWith, endsWith, in |
| `name`                 | `string` | equals, contains, startsWith, endsWith, in |
| `hostname`             | `string` | equals, contains, startsWith, endsWith, in |
| `ip_address`           | `string` | equals, contains, startsWith, endsWith, in |
| `user_agent`           | `string` | equals, contains, startsWith, endsWith, in |
| `version`              | `string` | equals, contains, startsWith, endsWith, in |
| `os_id`                | `string` | equals, contains, startsWith, endsWith, in |
| `arch`                 | `string` | equals, contains, startsWith, endsWith, in |
| `queue`                | `string` | equals, contains, startsWith, endsWith, in |
| `created_at`           | `string` | equals, contains, startsWith, endsWith, in |
| `connected_at`         | `string` | equals, contains, startsWith, endsWith, in |
| `disconnected_at`      | `string` | equals, contains, startsWith, endsWith, in |
| `lost_at`              | `string` | equals, contains, startsWith, endsWith, in |
| `stopped_at`           | `string` | equals, contains, startsWith, endsWith, in |
| `last_job_finished_at` | `string` | equals, contains, startsWith, endsWith, in |
| `priority`             | `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).*

***

## Meta

Path: `buildkite.db.meta.search`

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

### Searchable filters

| Field       | Type     | Operators                                  |
| ----------- | -------- | ------------------------------------------ |
| `entity_id` | `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).*

***

## Organizations

Path: `buildkite.db.organizations.search`

```ts theme={null}
const rows = await corsair.buildkite.db.organizations.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 |
| `graphql_id`    | `string` | equals, contains, startsWith, endsWith, in |
| `url`           | `string` | equals, contains, startsWith, endsWith, in |
| `web_url`       | `string` | equals, contains, startsWith, endsWith, in |
| `name`          | `string` | equals, contains, startsWith, endsWith, in |
| `slug`          | `string` | equals, contains, startsWith, endsWith, in |
| `pipelines_url` | `string` | equals, contains, startsWith, endsWith, in |
| `agents_url`    | `string` | equals, contains, startsWith, endsWith, in |
| `emojis_url`    | `string` | equals, contains, startsWith, endsWith, in |
| `created_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).*

***

## Users

Path: `buildkite.db.users.search`

```ts theme={null}
const rows = await corsair.buildkite.db.users.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 |
| `graphql_id` | `string` | equals, contains, startsWith, endsWith, in |
| `name`       | `string` | equals, contains, startsWith, endsWith, in |
| `email`      | `string` | equals, contains, startsWith, endsWith, in |
| `avatar_url` | `string` | equals, contains, startsWith, endsWith, in |
| `created_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).*

***
