#query-language #python #javascript #sql #graphql #query #engine #language #combination #js

bin+lib trustfall_core

The trustfall query engine, empowering you to query everything

14 unstable releases (3 breaking)

new 0.3.3 Mar 23, 2023
0.2.1 Feb 24, 2023
0.1.1 Dec 6, 2022
0.1.0 Jul 9, 2022
0.0.7 Nov 10, 2022

#132 in WebAssembly

Download history 1067/week @ 2022-12-01 2071/week @ 2022-12-08 709/week @ 2022-12-15 538/week @ 2022-12-22 597/week @ 2022-12-29 2003/week @ 2023-01-05 429/week @ 2023-01-12 1497/week @ 2023-01-19 541/week @ 2023-01-26 433/week @ 2023-02-02 780/week @ 2023-02-09 752/week @ 2023-02-16 914/week @ 2023-02-23 590/week @ 2023-03-02 429/week @ 2023-03-09 443/week @ 2023-03-16

2,550 downloads per month
Used in 5 crates


84K SLoC

Rusty Object Notation 70K SLoC // 0.0% comments Rust 10K SLoC // 0.0% comments R 3.5K SLoC GraphQL 1K SLoC // 0.0% comments FORTRAN Legacy 1 SLoC Forth 1 SLoC

trustfall — How to Query (Almost) Everything

This repository contains the trustfall query engine, which can be used to query any data source or combination of data sources: databases, APIs, raw files (JSON, CSV, etc.), git version control, etc. For a 10min video introduction to the project, see the "How to Query (Almost) Everything" talk from the HYTRADBOI 2022 conference.

Terminal recording of running cargo run --release -- query example_queries/actions_in_repos_with_min_10_hn_pts.ron in the demo-hytradboi demo project. The system returns the first 20 results of the query in 6.36 seconds."

Demo showing the execution of the cross-API query: "Which GitHub Actions are used in projects on the front page of HackerNews with >=10 points?"

The demo executes the following query across the HackerNews and GitHub APIs and over the YAML-formatted GitHub repository workflow files:

  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

This demo is part of the "How to Query (Almost) Everything" talk from the HYTRADBOI 2022 conference. Instructions for running the demo are available together with the source code in the demo-hytradboi directory: link.

Example Trustfall implementations

Using Trustfall over a new data source

The easiest way to plug in a new data source is by implementing the BasicAdapter trait.

Python bindings are available, and are built automatically on every change to the engine; the most recent version may be downloaded here. A getting started guide for Python is forthcoming (tracking issue); in the meantime, the best resource is the Python bindings' test suite.

Directory Registry

Copyright 2022-present Predrag Gruevski.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The present date is determined by the timestamp of the most recent commit in the repository. By accessing, and contributing code, comments, or issues to this repository, you are agreeing that all your contributions may be used, modified, copied, and/or redistributed under any terms chosen by the original author and/or future maintainers of this project.


~160K SLoC