Trustfall查詢?nèi)魏晤愋偷臄?shù)據(jù)源
Trustfall 是一個(gè)查詢引擎,用于查詢?nèi)魏晤愋偷臄?shù)據(jù)源,從 API 和數(shù)據(jù)庫(kù)到磁盤上的任何類型的文件,甚至是 AI 模型。
Trustfall Playground 支持針對(duì)公共數(shù)據(jù)源運(yùn)行查詢,例如:
- HackerNews REST API:https://play.predr.ag/hackernews
- top Rust crates 的 rustdoc JSON:https://play.predr.ag/rustdoc
例如, 此鏈接顯示了 HackerNews 查詢的結(jié)果:“哪些 GitHub 或 Twitter 用戶正在評(píng)論有關(guān) OpenAI 的故事?”
在 Playground 中,Trustfall 配置為作為 WASM 在客戶端運(yùn)行,在瀏覽器中執(zhí)行查詢處理的所有方面(解析、編譯和執(zhí)行)。雖然此演示突出了 Trustfall 嵌入目標(biāo)應(yīng)用程序的能力,但它當(dāng)然也可以用于更傳統(tǒng)的客戶端-服務(wù)器上下文中。
演示
展示跨 API 查詢的執(zhí)行情況: "哪些 GitHub Actions 被用于 HackerNews 首頁(yè)上的項(xiàng)目,且 >=10 points?"
該演示在 HackerNews 和 GitHub 的 API 以及 YAML 格式的 GitHub 倉(cāng)庫(kù)工作流文件上執(zhí)行了以下查詢:
{
HackerNewsTop(max: 200) {
... on HackerNewsStory {
hn_score: score @filter(op: ">=", value: ["$min_score"]) @output
link {
... on GitHubRepository {
repo_url: url @output
workflows {
workflow: name @output
workflow_path: path @output
jobs {
job: name @output
step {
... on GitHubActionsImportedStep {
step: name @output
action: uses @output
}
}
}
}
}
}
}
}
}
運(yùn)行演示的說(shuō)明與源代碼一起在demo-hytradboi目錄下提供 :鏈接。
評(píng)論
圖片
表情
