Reusable adapter for (local) file search #225
Replies: 2 comments 1 reply
-
This is great, and is a great example of exactly what Trustfall exists to make easy and pleasant! Thanks for sharing! Logistically, it'll probably be easiest to keep community adapters in their own repos. If you send me a link, I'll start a "Community Adapters" section in the README and docs and I'd be happy to link to it there. Thanks for asking about using the name. Feel free to include "trustfall" as part of the repo name, and consider using a README title like " adapter for Trustfall" ideally linking to the Trustfall repo. I'm hoping that cleanly balances between the clarity of the use case ("it's a Trustfall adapter! use it to query ") and the fact that the source code in that repo is its own thing, not affiliated with or endorsed by the Trustfall project itself. The "not affiliated" part is important to me because I'd love to avoid the sort of thing the author of |
Beta Was this translation helpful? Give feedback.
-
I have just published 3 adapters to crates.io, available here https://github.com/ZimboPro/trustfall-adapters. Adapters for OpenAPI, Terraform and a very simplified filesystem based off of your schema @JulianWgs . More than welcome to contribute if you want to :) |
Beta Was this translation helpful? Give feedback.
-
Hi,
to learn trustfall I've implemented a small adapter for search through local files. I'm very pleasent with the result as these kind of searches could only be done with one-off scripts beforehand, but now there just a trustfall query away.
This is my schema:
Here are some simple example queries using this schema (without arguments).
List all images which created by stable diffusion:
List all local only (without remote) repositories, which have a branch named master:
Search through all PDF Files in folder recursively and list page number
With this schema I've tried to create a recognizable and reusable type system. I've seen some of your queries (couldnt find them anymore) searching for files, but they contained more function names rather than technical terms (a Path can be either be a file or directory; a directory can be a git repo). How do you like it? Do you think this is a good starting point?
One future goal of this schema is to have an abstraction around versions of a file. When searching through a git repo multiple version of that file exist. The same is true for cloud storage solutions like Dropbox or filesystem like BTRFS. It would be really cool to search through all versions of a file with one query.
Where should these community adapters go? Do you want me to create a pull request for this repo or to create them in another repo? Can I use the name trustfall in the repo name?
I've currently implemented the adapter in Python, but am on the way to converting it to Rust. The end goal being to create a powerful Desktop application to search the filesystem.
Best regards & thanks for all the great work you've done.
Julian
Beta Was this translation helpful? Give feedback.
All reactions