nestrs_core/database.rs
1//! Generic database connectivity hook (NestJS “Database” techniques chapter analogue).
2
3use async_trait::async_trait;
4
5/// Minimal health / connectivity check shared by SQL, Prisma, Mongo, and custom drivers.
6#[async_trait]
7pub trait DatabasePing: Send + Sync {
8 /// Cheap round-trip (for example `SELECT 1` or `ping` command).
9 async fn ping_database(&self) -> Result<(), String>;
10}