Back to Prefect

orm_models

docs/v3/api-ref/python/prefect-server-database-orm_models.mdx

3.6.30.dev329.2 KB
Original Source

prefect.server.database.orm_models

Classes

Base <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L57" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

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

Flow <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L138" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy mixin of a flow.

FlowRunState <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L161" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy mixin of a flow run state.

Methods:

as_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L208" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
as_state(self) -> schemas.states.State

data <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L195" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
data(self) -> Optional[Any]

TaskRunState <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L224" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a task run state.

Methods:

as_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L272" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
as_state(self) -> schemas.states.State

data <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L259" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
data(self) -> Optional[Any]

Artifact <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L288" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of artifacts.

ArtifactCollection <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L329" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

TaskRunStateCache <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L353" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a task run state cache.

Run <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Common columns and logic for FlowRun and TaskRun models

Methods:

estimated_run_time <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L397" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L431" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L475" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a flow run.

Methods:

estimated_run_time <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L397" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L431" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L553" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L540" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
state(self) -> Optional[FlowRunState]

TaskRun <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L654" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a task run.

Methods:

estimated_run_time <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L397" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L431" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L706" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L693" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
state(self) -> Optional[TaskRunState]

DeploymentSchedule <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L782" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Deployment <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L815" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a deployment.

Methods:

job_variables <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L836" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
job_variables(self) -> Mapped[dict[str, Any]]

Log <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L924" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a logging statement.

ConcurrencyLimit <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L947" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

ConcurrencyLimitV2 <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L957" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

BlockType <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L970" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

BlockSchema <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L991" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

BlockSchemaReference <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1023" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

BlockDocument <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1035" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Methods:

decrypt_data <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1075" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1067" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1084" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Configuration <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1096" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SavedSearch <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1103" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a saved search.

WorkQueue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of a work queue

WorkPool <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1151" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of an worker

Worker <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1188" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of an worker

Agent <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1217" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLAlchemy model of an agent

Variable <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1233" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

FlowRunInput <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1241" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

CsrfToken <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1253" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1259" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Methods:

sort_expression <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1283" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
sort_expression(cls, value: AutomationSort) -> sa.ColumnExpressionArgument[Any]

Return an expression used to sort Automations

AutomationBucket <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1294" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

AutomationRelatedResource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1332" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

CompositeTriggerChildFiring <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1356" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

AutomationEventFollower <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1379" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Event <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1401" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

EventResource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1450" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

BaseORMConfiguration <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1513" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></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><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1554" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
artifact_collection_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting an ArtifactCollection

block_document_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1583" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_document_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockDocument

block_schema_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1559" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_schema_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockSchema

block_type_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1549" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_type_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockType

concurrency_limit_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1539" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
concurrency_limit_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a ConcurrencyLimit

deployment_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1534" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
deployment_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a Deployment

flow_run_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1544" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
flow_run_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a FlowRun

flow_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1564" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
flow_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a Flow

saved_search_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1569" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
saved_search_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a SavedSearch

task_run_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1574" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
task_run_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a TaskRun

unique_key <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1521" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
unique_key(self) -> tuple[Hashable, ...]

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

versions_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1529" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
versions_dir(self) -> Path

Directory containing migrations

AsyncPostgresORMConfiguration <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1588" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Postgres specific orm configuration

Methods:

artifact_collection_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1554" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
artifact_collection_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting an ArtifactCollection

block_document_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1583" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_document_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockDocument

block_schema_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1559" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_schema_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockSchema

block_type_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1549" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_type_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockType

concurrency_limit_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1539" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
concurrency_limit_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a ConcurrencyLimit

deployment_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1534" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
deployment_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a Deployment

flow_run_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1544" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
flow_run_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a FlowRun

flow_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1564" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
flow_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a Flow

saved_search_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1569" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
saved_search_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a SavedSearch

task_run_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1574" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
task_run_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a TaskRun

unique_key <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1521" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
unique_key(self) -> tuple[Hashable, ...]

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

versions_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1592" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
versions_dir(self) -> Path

Directory containing migrations

versions_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1529" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
versions_dir(self) -> Path

Directory containing migrations

AioSqliteORMConfiguration <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1604" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

SQLite specific orm configuration

Methods:

artifact_collection_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1554" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
artifact_collection_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting an ArtifactCollection

block_document_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1583" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_document_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockDocument

block_schema_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1559" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_schema_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockSchema

block_type_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1549" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
block_type_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a BlockType

concurrency_limit_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1539" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
concurrency_limit_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a ConcurrencyLimit

deployment_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1534" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
deployment_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a Deployment

flow_run_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1544" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
flow_run_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a FlowRun

flow_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1564" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
flow_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a Flow

saved_search_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1569" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
saved_search_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a SavedSearch

task_run_unique_upsert_columns <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1574" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
task_run_unique_upsert_columns(self) -> _UpsertColumns

Unique columns for upserting a TaskRun

unique_key <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1521" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
unique_key(self) -> tuple[Hashable, ...]

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

versions_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1608" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
versions_dir(self) -> Path

Directory containing migrations

versions_dir <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/database/orm_models.py#L1529" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
versions_dir(self) -> Path

Directory containing migrations