mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat: realtime user analytics (#5098)
Co-authored-by: Sampras Lopes <Sampras.lopes@juspay.in>
This commit is contained in:
@ -542,6 +542,8 @@ impl ToSql<SqlxClient> for AnalyticsCollection {
|
||||
Self::Payment => Ok("payment_attempt".to_string()),
|
||||
Self::Refund => Ok("refund".to_string()),
|
||||
Self::SdkEvents => Err(error_stack::report!(ParsingError::UnknownError)
|
||||
.attach_printable("SdkEventsAudit table is not implemented for Sqlx"))?,
|
||||
Self::SdkEventsAnalytics => Err(error_stack::report!(ParsingError::UnknownError)
|
||||
.attach_printable("SdkEvents table is not implemented for Sqlx"))?,
|
||||
Self::ApiEvents => Err(error_stack::report!(ParsingError::UnknownError)
|
||||
.attach_printable("ApiEvents table is not implemented for Sqlx"))?,
|
||||
@ -550,6 +552,8 @@ impl ToSql<SqlxClient> for AnalyticsCollection {
|
||||
.attach_printable("ConnectorEvents table is not implemented for Sqlx"))?,
|
||||
Self::ApiEventsAnalytics => Err(error_stack::report!(ParsingError::UnknownError)
|
||||
.attach_printable("ApiEvents table is not implemented for Sqlx"))?,
|
||||
Self::ActivePaymentsAnalytics => Err(error_stack::report!(ParsingError::UnknownError)
|
||||
.attach_printable("ActivePaymentsAnalytics table is not implemented for Sqlx"))?,
|
||||
Self::OutgoingWebhookEvent => Err(error_stack::report!(ParsingError::UnknownError)
|
||||
.attach_printable("OutgoingWebhookEvents table is not implemented for Sqlx"))?,
|
||||
Self::Dispute => Ok("dispute".to_string()),
|
||||
@ -610,6 +614,15 @@ where
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
)
|
||||
}
|
||||
Self::DistinctCount { field, alias } => {
|
||||
format!(
|
||||
"count(distinct {}){}",
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to distinct count aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user