#local-file #query-language #sql-query #file #git-ql #language #cli-file

app fileql

使用GitQL SDK在本地文件上运行类似SQL查询的工具

7个版本 (破坏性更新)

0.7.0 2024年8月4日
0.6.0 2024年8月4日
0.5.0 2024年6月13日
0.4.0 2024年6月4日
0.1.0 2024年2月16日

#843 in 命令行工具

Download history 172/week @ 2024-04-29 3/week @ 2024-05-20 124/week @ 2024-06-03 133/week @ 2024-06-10 12/week @ 2024-06-17 133/week @ 2024-07-29 106/week @ 2024-08-05

每月下载量:239

MIT 协议

29KB
574 代码行

FileQL - 文件查询语言


Crates.io Deps Release GitHub release GitHub issues GitHub GitHub all releases

FileQL是一个工具,允许您使用GitQL SDK在本地文件上运行类似SQL的查询,而不是在数据库文件上。

animated


示例

注意,FileQL中的所有关键词都是不区分大小写的,类似于SQL。

SELECT 1
SELECT 1 + 2
SELECT LEN("File Query Language")
SELECT "One" IN ("One", "Two", "Three")
SELECT "File Query Language" LIKE "%Query%"

SELECT * FROM files
SELECT COUNT(path) from files
SELECT DISTINCT parent AS folders FROM files
SELECT CHILDREN_COUNT(parent) FROM files

文件表结构

名称 类型 描述
path 文本 文件路径
parent 文本 文件父路径
extension 文本 文件扩展名
is_dir 布尔值 如果是目录则为真
is_file 布尔值 如果是文件则为真
size 整数 文件大小

文件QL函数

名称 参数 返回 描述
FILES_COUNT 文本 整数 目录的子项数量或如果不是有效路径则为0

下载或安装

  • 从Cargo.io安装
cargo install fileql
  • 从Winget安装
winget install fileql
  • 从源代码构建
git clone https://github.com/AmrDeveloper/fileql.git
cd fileql
cargo build

运行FileQL

FileQL is a SQL like query language to run on local files
Usage: FileQL [OPTIONS]

Options:
  -f,  --files <paths>        Path for local files to run query on
  -e,  --excludes <paths>     Path for local files to exclude from query scope
  -q,  --query <GQL Query>    FileQL query to run on selected files
  -p,  --pagination           Enable print result with pagination
  -ps, --pagesize             Set pagination page size [default: 10]
  -o,  --output               Set output format [render, json, csv]
  -a,  --analysis             Print Query analysis
  -h,  --help                 Print FileQL help
  -v,  --version              Print FileQL Current Version

许可证

MIT License

Copyright (c) 2024 Amr Hesham

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

依赖项

~6–16MB
~175K SLoC