Documentation Index Fetch the complete documentation index at: https://docs.prefect.io/llms.txt
Use this file to discover all available pages before exploring further.
prefect.server.database.orm_models
Classes
Base
Base SQLAlchemy model that automatically infers the table name
and provides ID, created, and updated columns
Flow
SQLAlchemy mixin of a flow.
FlowRunState
SQLAlchemy mixin of a flow run state.
Methods:
as_state
as_state( self ) -> schemas.states.State
data
data( self ) -> Optional[Any]
TaskRunState
SQLAlchemy model of a task run state.
Methods:
as_state
as_state( self ) -> schemas.states.State
data
data( self ) -> Optional[Any]
Artifact
SQLAlchemy model of artifacts.
ArtifactCollection
TaskRunStateCache
SQLAlchemy model of a task run state cache.
Run
Common columns and logic for FlowRun and TaskRun models
Methods:
estimated_run_time
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
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
SQLAlchemy model of a flow run.
Methods:
estimated_run_time
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
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
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
state( self ) -> Optional[FlowRunState]
TaskRun
SQLAlchemy model of a task run.
Methods:
estimated_run_time
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
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
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
state( self ) -> Optional[TaskRunState]
DeploymentSchedule
Deployment
SQLAlchemy model of a deployment.
Methods:
job_variables
job_variables( self ) -> Mapped[dict[ str , Any]]
Log
SQLAlchemy model of a logging statement.
ConcurrencyLimit
ConcurrencyLimitV2
BlockType
BlockSchema
BlockSchemaReference
BlockDocument
Methods:
decrypt_data
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
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
Configuration
SavedSearch
SQLAlchemy model of a saved search.
WorkQueue
SQLAlchemy model of a work queue
WorkPool
SQLAlchemy model of an worker
Worker
SQLAlchemy model of an worker
Agent
SQLAlchemy model of an agent
Variable
CsrfToken
Automation
Methods:
sort_expression
sort_expression( cls , value: AutomationSort) -> sa.ColumnExpressionArgument[Any]
Return an expression used to sort Automations
AutomationBucket
CompositeTriggerChildFiring
AutomationEventFollower
Event
EventResource
BaseORMConfiguration
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
artifact_collection_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting an ArtifactCollection
block_document_unique_upsert_columns
block_document_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockDocument
block_schema_unique_upsert_columns
block_schema_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockSchema
block_type_unique_upsert_columns
block_type_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockType
concurrency_limit_unique_upsert_columns
concurrency_limit_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a ConcurrencyLimit
deployment_unique_upsert_columns
deployment_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a Deployment
flow_run_unique_upsert_columns
flow_run_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a FlowRun
flow_unique_upsert_columns
flow_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a Flow
saved_search_unique_upsert_columns
saved_search_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a SavedSearch
task_run_unique_upsert_columns
task_run_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a TaskRun
unique_key
unique_key( self ) -> tuple[Hashable, ... ]
Returns a key used to determine whether to instantiate a new DB interface.
versions_dir
versions_dir( self ) -> Path
Directory containing migrations
AsyncPostgresORMConfiguration
Postgres specific orm configuration
Methods:
artifact_collection_unique_upsert_columns
artifact_collection_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting an ArtifactCollection
block_document_unique_upsert_columns
block_document_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockDocument
block_schema_unique_upsert_columns
block_schema_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockSchema
block_type_unique_upsert_columns
block_type_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockType
concurrency_limit_unique_upsert_columns
concurrency_limit_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a ConcurrencyLimit
deployment_unique_upsert_columns
deployment_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a Deployment
flow_run_unique_upsert_columns
flow_run_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a FlowRun
flow_unique_upsert_columns
flow_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a Flow
saved_search_unique_upsert_columns
saved_search_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a SavedSearch
task_run_unique_upsert_columns
task_run_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a TaskRun
unique_key
unique_key( self ) -> tuple[Hashable, ... ]
Returns a key used to determine whether to instantiate a new DB interface.
versions_dir
versions_dir( self ) -> Path
Directory containing migrations
versions_dir
versions_dir( self ) -> Path
Directory containing migrations
AioSqliteORMConfiguration
SQLite specific orm configuration
Methods:
artifact_collection_unique_upsert_columns
artifact_collection_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting an ArtifactCollection
block_document_unique_upsert_columns
block_document_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockDocument
block_schema_unique_upsert_columns
block_schema_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockSchema
block_type_unique_upsert_columns
block_type_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a BlockType
concurrency_limit_unique_upsert_columns
concurrency_limit_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a ConcurrencyLimit
deployment_unique_upsert_columns
deployment_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a Deployment
flow_run_unique_upsert_columns
flow_run_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a FlowRun
flow_unique_upsert_columns
flow_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a Flow
saved_search_unique_upsert_columns
saved_search_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a SavedSearch
task_run_unique_upsert_columns
task_run_unique_upsert_columns( self ) -> _UpsertColumns
Unique columns for upserting a TaskRun
unique_key
unique_key( self ) -> tuple[Hashable, ... ]
Returns a key used to determine whether to instantiate a new DB interface.
versions_dir
versions_dir( self ) -> Path
Directory containing migrations
versions_dir
versions_dir( self ) -> Path
Directory containing migrations