N3HHUT2CUKITDQ73WS5XP5S6A3CAM5OUVYDKIZVZXE4DDS77HCIAC
}
pub async fn check_depth(&self, a: i64, cutoff: i64) -> DynResult<i64> {
self.post(|conn| {
let mut stmnt = conn.prepare("WITH RECURSIVE t(better,worse) AS (SELECT better, worse FROM preferences WHERE preferences.worse = ? UNION SELECT preferences.better, t.worse FROM preferences INNER JOIN t ON preferences.worse = t.better) SELECT count(*) FROM (SELECT DISTINCT better FROM t) LIMIT ?")?;
stmnt.bind::<i64>(1, a)?;
stmnt.bind::<i64>(2, cutoff)?;
match stmnt.next()? {
sqlite::State::Done => Ok(0),
sqlite::State::Row => Ok(stmnt.read::<i64>(0)?),
}
}).await?