pub trait GenAIDriftSqlLogic {
Show 19 methods
// Provided methods
fn insert_genai_eval_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: BoxedGenAIEvalRecord,
entity_id: &'life1 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn insert_genai_eval_workflow_record<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 GenAIEvalWorkflowResult,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn insert_eval_task_results_batch<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [GenAIEvalTaskResult],
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_genai_eval_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: Option<&'life1 DateTime<Utc>>,
status: Option<Status>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenAIEvalRecord>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_paginated_genai_eval_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 GenAIEvalRecordPaginationRequest,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<GenAIEvalRecordPaginationResponse, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_genai_eval_task<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record_uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenAIEvalTaskResult>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_paginated_genai_eval_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 GenAIEvalRecordPaginationRequest,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<GenAIEvalWorkflowPaginationResponse, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_genai_task_values<'life0, 'life1, 'life2, 'life3, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
metrics: &'life2 [String],
entity_id: &'life3 i32,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn get_genai_workflow_value<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<Option<f64>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_binned_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_binned_task_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn merge_feature_results(
results: BinnedMetrics,
map: &mut BinnedMetrics,
) -> Result<(), SqlError> { ... }
fn get_archived_task_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_archived_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn get_binned_genai_task_values<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
retention_period: &'life2 i32,
storage_settings: &'life3 ObjectStorageSettings,
entity_id: &'life4 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
fn get_binned_genai_workflow_values<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
retention_period: &'life2 i32,
storage_settings: &'life3 ObjectStorageSettings,
entity_id: &'life4 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
fn get_pending_genai_eval_record<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Option<GenAIEvalRecord>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait { ... }
fn update_genai_eval_record_status<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 GenAIEvalRecord,
status: Status,
workflow_duration: &'life2 i64,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn reschedule_genai_eval_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
uid: &'life1 str,
delay: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
}Provided Methods§
Sourcefn insert_genai_eval_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: BoxedGenAIEvalRecord,
entity_id: &'life1 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_genai_eval_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: BoxedGenAIEvalRecord,
entity_id: &'life1 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn insert_genai_eval_workflow_record<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 GenAIEvalWorkflowResult,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn insert_genai_eval_workflow_record<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 GenAIEvalWorkflowResult,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn insert_eval_task_results_batch<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [GenAIEvalTaskResult],
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn insert_eval_task_results_batch<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
records: &'life1 [GenAIEvalTaskResult],
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<PgQueryResult, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Inserts a batch of GenAI metric values into the database. This is the output from processing/evaluating the GenAI drift records.
fn get_genai_eval_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: Option<&'life1 DateTime<Utc>>,
status: Option<Status>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenAIEvalRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn get_paginated_genai_eval_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 GenAIEvalRecordPaginationRequest,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<GenAIEvalRecordPaginationResponse, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_paginated_genai_eval_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 GenAIEvalRecordPaginationRequest,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<GenAIEvalRecordPaginationResponse, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves a paginated list of GenAI drift records with bidirectional cursor support
§Arguments
pool- The database connection poolparams- The pagination request containing limit, cursor, and directionentity_id- The entity ID to filter records
§Returns
- Result with paginated response containing GenAI drift records
Sourcefn get_genai_eval_task<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record_uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenAIEvalTaskResult>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn get_genai_eval_task<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record_uid: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenAIEvalTaskResult>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_paginated_genai_eval_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 GenAIEvalRecordPaginationRequest,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<GenAIEvalWorkflowPaginationResponse, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_paginated_genai_eval_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 GenAIEvalRecordPaginationRequest,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<GenAIEvalWorkflowPaginationResponse, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves a paginated list of GenAI workflow records with bidirectional cursor support
§Arguments
pool- The database connection poolparams- The pagination request containing limit, cursor, and directionentity_id- The entity ID to filter records
§Returns
- Result with paginated response containing GenAI workflow records
Sourcefn get_genai_task_values<'life0, 'life1, 'life2, 'life3, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
metrics: &'life2 [String],
entity_id: &'life3 i32,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_genai_task_values<'life0, 'life1, 'life2, 'life3, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
metrics: &'life2 [String],
entity_id: &'life3 i32,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Queries the database for GenAI task metric values based on a time window.
§Arguments
pool- The database connection poollimit_datetime- The limit datetime to get metric values formetrics- The list of metric names to retrieveentity_id- The entity ID to filter records
§Returns
- A hashmap of metric names to their corresponding values
Sourcefn get_genai_workflow_value<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<Option<f64>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_genai_workflow_value<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
limit_datetime: &'life1 DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<Option<f64>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn get_binned_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_binned_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn get_binned_task_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_binned_task_records<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
start_dt: DateTime<Utc>,
end_dt: DateTime<Utc>,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn merge_feature_results(
results: BinnedMetrics,
map: &mut BinnedMetrics,
) -> Result<(), SqlError>
fn merge_feature_results( results: BinnedMetrics, map: &mut BinnedMetrics, ) -> Result<(), SqlError>
Helper for merging custom drift records
Sourcefn get_archived_task_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_archived_task_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
DataFusion implementation for getting custom drift records from archived data. Queries for task records
§Arguments
params- The drift request parametersbegin- The start time of the time windowend- The end time of the time windowminutes- The number of minutes to bin the datastorage_settings- The object storage settingsentity_id- The entity ID to filter records
§Returns
- A vector of drift records
Sourcefn get_archived_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_archived_workflow_records<'life0, 'life1, 'life2, 'async_trait>(
params: &'life0 DriftRequest,
begin: DateTime<Utc>,
end: DateTime<Utc>,
minutes: i32,
storage_settings: &'life1 ObjectStorageSettings,
entity_id: &'life2 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
DataFusion implementation for getting custom drift records from archived data. Queries for task records
§Arguments
params- The drift request parametersbegin- The start time of the time windowend- The end time of the time windowminutes- The number of minutes to bin the datastorage_settings- The object storage settingsentity_id- The entity ID to filter records
§Returns
- A vector of drift records
fn get_binned_genai_task_values<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
retention_period: &'life2 i32,
storage_settings: &'life3 ObjectStorageSettings,
entity_id: &'life4 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn get_binned_genai_workflow_values<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
pool: &'life0 Pool<Postgres>,
params: &'life1 DriftRequest,
retention_period: &'life2 i32,
storage_settings: &'life3 ObjectStorageSettings,
entity_id: &'life4 i32,
) -> Pin<Box<dyn Future<Output = Result<BinnedMetrics, SqlError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Sourcefn get_pending_genai_eval_record<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Option<GenAIEvalRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn get_pending_genai_eval_record<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Option<GenAIEvalRecord>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Retrieves the next pending GenAI drift task from drift_records.
fn update_genai_eval_record_status<'life0, 'life1, 'life2, 'async_trait>(
pool: &'life0 Pool<Postgres>,
record: &'life1 GenAIEvalRecord,
status: Status,
workflow_duration: &'life2 i64,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn reschedule_genai_eval_record<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
uid: &'life1 str,
delay: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.