> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# orm_models

# `prefect.server.database.orm_models`

## Classes

### `Base` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L57](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L57)</sup>

Base SQLAlchemy model that automatically infers the table name
and provides ID, created, and updated columns

### `Flow` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L138](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L138)</sup>

SQLAlchemy mixin of a flow.

### `FlowRunState` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L161](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L161)</sup>

SQLAlchemy mixin of a flow run state.

**Methods:**

#### `as_state` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L208](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L208)</sup>

```python theme={null}
as_state(self) -> schemas.states.State
```

#### `data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L195](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L195)</sup>

```python theme={null}
data(self) -> Optional[Any]
```

### `TaskRunState` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L224](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L224)</sup>

SQLAlchemy model of a task run state.

**Methods:**

#### `as_state` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L272](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L272)</sup>

```python theme={null}
as_state(self) -> schemas.states.State
```

#### `data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L259](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L259)</sup>

```python theme={null}
data(self) -> Optional[Any]
```

### `Artifact` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L288](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L288)</sup>

SQLAlchemy model of artifacts.

### `ArtifactCollection` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L329](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L329)</sup>

### `TaskRunStateCache` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L353](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L353)</sup>

SQLAlchemy model of a task run state cache.

### `Run` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L374](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L374)</sup>

Common columns and logic for FlowRun and TaskRun models

**Methods:**

#### `estimated_run_time` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L397](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L397)</sup>

```python theme={null}
estimated_run_time(self) -> datetime.timedelta
```

Total run time is incremented in the database whenever a RUNNING
state is exited. To give up-to-date estimates, we estimate incremental
run time for any runs currently in a RUNNING state.

#### `estimated_start_time_delta` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L431](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L431)</sup>

```python theme={null}
estimated_start_time_delta(self) -> datetime.timedelta
```

The delta to the expected start time (or "lateness") is computed as
the difference between the actual start time and expected start time. To
give up-to-date estimates, we estimate lateness for any runs that don't
have a start time and are not in a final state and were expected to
start already.

### `FlowRun` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L475](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L475)</sup>

SQLAlchemy model of a flow run.

**Methods:**

#### `estimated_run_time` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L397](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L397)</sup>

```python theme={null}
estimated_run_time(self) -> datetime.timedelta
```

Total run time is incremented in the database whenever a RUNNING
state is exited. To give up-to-date estimates, we estimate incremental
run time for any runs currently in a RUNNING state.

#### `estimated_start_time_delta` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L431](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L431)</sup>

```python theme={null}
estimated_start_time_delta(self) -> datetime.timedelta
```

The delta to the expected start time (or "lateness") is computed as
the difference between the actual start time and expected start time. To
give up-to-date estimates, we estimate lateness for any runs that don't
have a start time and are not in a final state and were expected to
start already.

#### `set_state` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L553](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L553)</sup>

```python theme={null}
set_state(self, state: Optional[FlowRunState]) -> None
```

If a state is assigned to this run, populate its run id.

This would normally be handled by the back-populated SQLAlchemy
relationship, but because this is a one-to-one pointer to a
one-to-many relationship, SQLAlchemy can't figure it out.

#### `state` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L540](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L540)</sup>

```python theme={null}
state(self) -> Optional[FlowRunState]
```

### `TaskRun` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L659](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L659)</sup>

SQLAlchemy model of a task run.

**Methods:**

#### `estimated_run_time` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L397](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L397)</sup>

```python theme={null}
estimated_run_time(self) -> datetime.timedelta
```

Total run time is incremented in the database whenever a RUNNING
state is exited. To give up-to-date estimates, we estimate incremental
run time for any runs currently in a RUNNING state.

#### `estimated_start_time_delta` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L431](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L431)</sup>

```python theme={null}
estimated_start_time_delta(self) -> datetime.timedelta
```

The delta to the expected start time (or "lateness") is computed as
the difference between the actual start time and expected start time. To
give up-to-date estimates, we estimate lateness for any runs that don't
have a start time and are not in a final state and were expected to
start already.

#### `set_state` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L711](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L711)</sup>

```python theme={null}
set_state(self, state: Optional[TaskRunState]) -> None
```

If a state is assigned to this run, populate its run id.

This would normally be handled by the back-populated SQLAlchemy
relationship, but because this is a one-to-one pointer to a
one-to-many relationship, SQLAlchemy can't figure it out.

#### `state` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L698](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L698)</sup>

```python theme={null}
state(self) -> Optional[TaskRunState]
```

### `DeploymentSchedule` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L787](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L787)</sup>

### `Deployment` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L820](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L820)</sup>

SQLAlchemy model of a deployment.

**Methods:**

#### `job_variables` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L841](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L841)</sup>

```python theme={null}
job_variables(self) -> Mapped[dict[str, Any]]
```

### `Log` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L929](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L929)</sup>

SQLAlchemy model of a logging statement.

### `ConcurrencyLimit` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L952](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L952)</sup>

### `ConcurrencyLimitV2` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L962](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L962)</sup>

### `BlockType` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L975](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L975)</sup>

### `BlockSchema` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L996](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L996)</sup>

### `BlockSchemaReference` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1028](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1028)</sup>

### `BlockDocument` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1040](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1040)</sup>

**Methods:**

#### `decrypt_data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1080](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1080)</sup>

```python theme={null}
decrypt_data(self, session: AsyncSession) -> dict[str, Any]
```

Retrieve decrypted data from the ORM model.

Note: will only succeed if the caller has sufficient permission.

#### `encrypt_data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1072](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1072)</sup>

```python theme={null}
encrypt_data(self, session: AsyncSession, data: dict[str, Any]) -> None
```

Store encrypted data on the ORM model

Note: will only succeed if the caller has sufficient permission.

### `BlockDocumentReference` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1089](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1089)</sup>

### `Configuration` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1108](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1108)</sup>

### `SavedSearch` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1115](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1115)</sup>

SQLAlchemy model of a saved search.

### `WorkQueue` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1126](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1126)</sup>

SQLAlchemy model of a work queue

### `WorkPool` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1163](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1163)</sup>

SQLAlchemy model of an worker

### `Worker` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1200](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1200)</sup>

SQLAlchemy model of an worker

### `Agent` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1229](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1229)</sup>

SQLAlchemy model of an agent

### `Variable` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1245](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1245)</sup>

### `FlowRunInput` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1253](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1253)</sup>

### `CsrfToken` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1265](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1265)</sup>

### `Automation` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1271](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1271)</sup>

**Methods:**

#### `sort_expression` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1295](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1295)</sup>

```python theme={null}
sort_expression(cls, value: AutomationSort) -> sa.ColumnExpressionArgument[Any]
```

Return an expression used to sort Automations

### `AutomationBucket` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1306](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1306)</sup>

### `AutomationHeldEvent` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1344](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1344)</sup>

An `expect` event of a proactive trigger with `after` that was evaluated
before any bucket existed for its key, held for a bucket that opens later.

### `AutomationRelatedResource` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1381](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1381)</sup>

### `CompositeTriggerChildFiring` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1405](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1405)</sup>

### `AutomationEventFollower` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1428](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1428)</sup>

### `Event` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1450](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1450)</sup>

### `EventResource` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1499](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1499)</sup>

### `BaseORMConfiguration` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1571](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1571)</sup>

Abstract base class used to inject database-specific ORM configuration into Prefect.

Modifications to core Prefect REST API data structures can have unintended consequences.
Use with caution.

**Methods:**

#### `artifact_collection_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1612](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1612)</sup>

```python theme={null}
artifact_collection_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting an ArtifactCollection

#### `block_document_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1641](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1641)</sup>

```python theme={null}
block_document_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockDocument

#### `block_schema_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1617](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1617)</sup>

```python theme={null}
block_schema_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockSchema

#### `block_type_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1607](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1607)</sup>

```python theme={null}
block_type_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockType

#### `concurrency_limit_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1597](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1597)</sup>

```python theme={null}
concurrency_limit_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a ConcurrencyLimit

#### `deployment_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1592](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1592)</sup>

```python theme={null}
deployment_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a Deployment

#### `flow_run_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1602](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1602)</sup>

```python theme={null}
flow_run_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a FlowRun

#### `flow_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1622](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1622)</sup>

```python theme={null}
flow_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a Flow

#### `saved_search_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1627](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1627)</sup>

```python theme={null}
saved_search_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a SavedSearch

#### `task_run_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1632](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1632)</sup>

```python theme={null}
task_run_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a TaskRun

#### `unique_key` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1579](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1579)</sup>

```python theme={null}
unique_key(self) -> tuple[Hashable, ...]
```

Returns a key used to determine whether to instantiate a new DB interface.

#### `versions_dir` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1587](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1587)</sup>

```python theme={null}
versions_dir(self) -> Path
```

Directory containing migrations

### `AsyncPostgresORMConfiguration` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1646](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1646)</sup>

Postgres specific orm configuration

**Methods:**

#### `artifact_collection_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1612](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1612)</sup>

```python theme={null}
artifact_collection_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting an ArtifactCollection

#### `block_document_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1641](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1641)</sup>

```python theme={null}
block_document_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockDocument

#### `block_schema_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1617](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1617)</sup>

```python theme={null}
block_schema_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockSchema

#### `block_type_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1607](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1607)</sup>

```python theme={null}
block_type_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockType

#### `concurrency_limit_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1597](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1597)</sup>

```python theme={null}
concurrency_limit_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a ConcurrencyLimit

#### `deployment_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1592](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1592)</sup>

```python theme={null}
deployment_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a Deployment

#### `flow_run_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1602](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1602)</sup>

```python theme={null}
flow_run_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a FlowRun

#### `flow_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1622](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1622)</sup>

```python theme={null}
flow_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a Flow

#### `saved_search_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1627](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1627)</sup>

```python theme={null}
saved_search_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a SavedSearch

#### `task_run_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1632](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1632)</sup>

```python theme={null}
task_run_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a TaskRun

#### `unique_key` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1579](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1579)</sup>

```python theme={null}
unique_key(self) -> tuple[Hashable, ...]
```

Returns a key used to determine whether to instantiate a new DB interface.

#### `versions_dir` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1650](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1650)</sup>

```python theme={null}
versions_dir(self) -> Path
```

Directory containing migrations

#### `versions_dir` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1587](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1587)</sup>

```python theme={null}
versions_dir(self) -> Path
```

Directory containing migrations

### `AioSqliteORMConfiguration` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1662](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1662)</sup>

SQLite specific orm configuration

**Methods:**

#### `artifact_collection_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1612](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1612)</sup>

```python theme={null}
artifact_collection_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting an ArtifactCollection

#### `block_document_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1641](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1641)</sup>

```python theme={null}
block_document_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockDocument

#### `block_schema_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1617](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1617)</sup>

```python theme={null}
block_schema_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockSchema

#### `block_type_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1607](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1607)</sup>

```python theme={null}
block_type_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a BlockType

#### `concurrency_limit_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1597](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1597)</sup>

```python theme={null}
concurrency_limit_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a ConcurrencyLimit

#### `deployment_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1592](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1592)</sup>

```python theme={null}
deployment_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a Deployment

#### `flow_run_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1602](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1602)</sup>

```python theme={null}
flow_run_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a FlowRun

#### `flow_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1622](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1622)</sup>

```python theme={null}
flow_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a Flow

#### `saved_search_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1627](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1627)</sup>

```python theme={null}
saved_search_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a SavedSearch

#### `task_run_unique_upsert_columns` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1632](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1632)</sup>

```python theme={null}
task_run_unique_upsert_columns(self) -> _UpsertColumns
```

Unique columns for upserting a TaskRun

#### `unique_key` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1579](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1579)</sup>

```python theme={null}
unique_key(self) -> tuple[Hashable, ...]
```

Returns a key used to determine whether to instantiate a new DB interface.

#### `versions_dir` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1666](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1666)</sup>

```python theme={null}
versions_dir(self) -> Path
```

Directory containing migrations

#### `versions_dir` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1587](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1587)</sup>

```python theme={null}
versions_dir(self) -> Path
```

Directory containing migrations
