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

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

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

## Api Keys

Path: `neon.db.apiKeys.search`

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

***

## Branches

Path: `neon.db.branches.search`

```ts theme={null}
const rows = await corsair.neon.db.branches.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 |
| `project_id`    | `string`  | equals, contains, startsWith, endsWith, in |
| `name`          | `string`  | equals, contains, startsWith, endsWith, in |
| `parent_id`     | `string`  | equals, contains, startsWith, endsWith, in |
| `default`       | `boolean` | equals                                     |
| `current_state` | `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).*

***

## Compute Endpoints

Path: `neon.db.computeEndpoints.search`

```ts theme={null}
const rows = await corsair.neon.db.computeEndpoints.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 |
| `project_id`    | `string` | equals, contains, startsWith, endsWith, in |
| `branch_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `host`          | `string` | equals, contains, startsWith, endsWith, in |
| `type`          | `string` | equals, contains, startsWith, endsWith, in |
| `current_state` | `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).*

***

## Databases

Path: `neon.db.databases.search`

```ts theme={null}
const rows = await corsair.neon.db.databases.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               |
| `branch_id`  | `string` | equals, contains, startsWith, endsWith, in |
| `name`       | `string` | equals, contains, startsWith, endsWith, in |
| `owner_name` | `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).*

***

## Organizations

Path: `neon.db.organizations.search`

```ts theme={null}
const rows = await corsair.neon.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 |
| `name`      | `string` | equals, contains, startsWith, endsWith, in |
| `handle`    | `string` | equals, contains, startsWith, endsWith, in |
| `plan`      | `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).*

***

## Projects

Path: `neon.db.projects.search`

```ts theme={null}
const rows = await corsair.neon.db.projects.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 |
| `org_id`     | `string` | equals, contains, startsWith, endsWith, in |
| `region_id`  | `string` | equals, contains, startsWith, endsWith, in |
| `pg_version` | `number` | equals, gt, gte, lt, lte, 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).*

***

## Roles

Path: `neon.db.roles.search`

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

### Searchable filters

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

***

## Snapshots

Path: `neon.db.snapshots.search`

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

***
