+
+ pub async fn read_all(pool: &mut DbPool<'_>) -> Result<Vec<Instance>, Error> {
+ let conn = &mut get_conn(pool).await?;
+ instance::table
+ .select(instance::all_columns)
+ .get_results(conn)
+ .await
+ }
+
+ pub async fn dead_instances(pool: &mut DbPool<'_>) -> Result<Vec<String>, Error> {
+ let conn = &mut get_conn(pool).await?;
+ instance::table
+ .select(instance::domain)
+ .filter(coalesce(instance::updated, instance::published).lt(now - 3.days()))
+ .get_results(conn)
+ .await
+ }
+