MCPcopy Create free account
hub / github.com/Botloader/botloader / get_script_derived_freshness

Method get_script_derived_freshness

components/stores/src/config.rs:380–401  ·  view source on GitHub ↗

The inputs each of the guild's derived-state rows was observed under, used to skip the [Self::upsert_script_derived] write when nothing changed.

(
        &self,
        guild_id: Id<GuildMarker>,
    )

Source from the content-addressed store, hash-verified

378 /// The inputs each of the guild's derived-state rows was observed under,
379 /// used to skip the [Self::upsert_script_derived] write when nothing changed.
380 pub async fn get_script_derived_freshness(
381 &self,
382 guild_id: Id<GuildMarker>,
383 ) -> ConfigStoreResult<Vec<ScriptDerivedFreshness>> {
384 let rows = sqlx::query!(
385 "SELECT script_id, source_hash, settings_hash, runtime_version FROM \
386 guild_script_derived WHERE guild_id = $1",
387 guild_id.get() as i64,
388 )
389 .fetch_all(&self.pool)
390 .await?;
391
392 Ok(rows
393 .into_iter()
394 .map(|row| ScriptDerivedFreshness {
395 script_id: row.script_id as u64,
396 source_hash: row.source_hash,
397 settings_hash: row.settings_hash,
398 runtime_version: row.runtime_version,
399 })
400 .collect())
401 }
402
403 /// Command contributions of the guild's enabled scripts, without dragging
404 /// script sources along.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected