> ## 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#L230](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L230)</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#L278](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L278)</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#L265](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L265)</sup>

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

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

SQLAlchemy model of artifacts.

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

### `TaskRunStateCache` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L365](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L365)</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#L386](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L386)</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#L409](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L409)</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#L443](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L443)</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#L487](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L487)</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#L409](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L409)</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#L443](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L443)</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#L565](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L565)</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#L552](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L552)</sup>

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

### `TaskRun` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L671](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L671)</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#L409](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L409)</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#L443](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L443)</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#L723](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L723)</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#L710](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L710)</sup>

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

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

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

SQLAlchemy model of a deployment.

**Methods:**

#### `job_variables` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L853](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L853)</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#L941](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L941)</sup>

SQLAlchemy model of a logging statement.

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

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

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

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

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

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

**Methods:**

#### `decrypt_data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1092](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1092)</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#L1084](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1084)</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#L1101](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1101)</sup>

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

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

SQLAlchemy model of a saved search.

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

SQLAlchemy model of a work queue

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

SQLAlchemy model of an worker

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

SQLAlchemy model of an worker

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

SQLAlchemy model of an agent

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

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

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

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

**Methods:**

#### `sort_expression` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1307](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1307)</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#L1318](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1318)</sup>

### `AutomationHeldEvent` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1356](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1356)</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#L1393](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1393)</sup>

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

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

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

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

### `BaseORMConfiguration` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm\_models.py#L1583](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1583)</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#L1624](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1624)</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#L1653](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1653)</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#L1629](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1629)</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#L1619](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1619)</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#L1609](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1609)</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#L1604](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1604)</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#L1614](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1614)</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#L1634](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1634)</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#L1639](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1639)</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#L1644](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1644)</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#L1591](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1591)</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#L1599](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1599)</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#L1658](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1658)</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#L1624](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1624)</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#L1653](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1653)</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#L1629](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1629)</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#L1619](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1619)</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#L1609](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1609)</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#L1604](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1604)</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#L1614](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1614)</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#L1634](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1634)</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#L1639](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1639)</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#L1644](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1644)</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#L1591](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1591)</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#L1662](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1662)</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#L1599](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1599)</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#L1674](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1674)</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#L1624](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1624)</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#L1653](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1653)</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#L1629](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1629)</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#L1619](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1619)</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#L1609](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1609)</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#L1604](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1604)</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#L1614](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1614)</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#L1634](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1634)</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#L1639](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1639)</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#L1644](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1644)</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#L1591](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1591)</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#L1678](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1678)</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#L1599](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1599)</sup>

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

Directory containing migrations
