MCPcopy Index your code
hub / github.com/AmrDeveloper/GQL

github.com/AmrDeveloper/GQL @0.43.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.43.0 ↗ · + Follow
1,242 symbols 3,072 edges 116 files 155 documented · 12% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GitQL - Git Query Language

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

GitQL is a tool that built using the GitQL SDk to perform SQL like query on your local .git files

GitQL SDK is an in memory query engine implemented from scratch as a set of libraries that allow you to perform high customization in types, schema, data provider, operators and functions, so you can build your own tool to run SQL like query on any kind of data.

animated


Samples

Note that all Keywords in GitQL are case-insensitive, similar to SQL.

SELECT 1
SELECT 1 + 2
SELECT LEN("Git Query Language")
SELECT "One" IN ("One", "Two", "Three")
SELECT "Git Query Language" LIKE "%Query%"
SELECT INTERVAL '1 year 2 mons 3 days 04:05:06.789'
SELECT INTERVAL '1 millennium 2 centuries 1 decade ago'

SET @arr = [1, 2, 3];
SELECT [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
SELECT @arr[1], @arr[2], @arr[3], ARRAY_LENGTH(@arr);
SELECT @arr[1:2], @arr[2:], @arr[:2];

SELECT DISTINCT title AS tt FROM commits
SELECT author_name, COUNT(author_name) AS commit_num FROM commits GROUP BY author_name, author_email ORDER BY commit_num DESC LIMIT 10
SELECT commit_count FROM branches WHERE commit_count BETWEEN 0 AND 10

SELECT * FROM refs WHERE type = "branch"
SELECT * FROM refs ORDER BY type

SELECT * FROM commits
SELECT author_name, author_email FROM commits
SELECT author_name, author_email FROM commits ORDER BY author_name DESC, author_email ASC
SELECT author_name, author_email FROM commits WHERE author_email LIKE "%gmail%" ORDER BY author_name
SELECT * FROM commits WHERE LOWER(author_name) = "AmrDeveloper"
SELECT author_name FROM commits GROUP By author_name
SELECT author_name FROM commits GROUP By author_name HAVING author_name = "AmrDeveloper"

SELECT * FROM branches
SELECT * FROM branches WHERE is_head = true
SELECT name, LEN(name) FROM branches

SELECT * FROM tags
SELECT * FROM tags OFFSET 1 LIMIT 1

SELECT path, count() AS changes_count, SUM(insertions) AS additions, SUM(removals) AS removes FROM diffs_changes GROUP BY path ORDER BY changes_count DESC

GitQL Documentation

GitQL SDK Documentations


Tools built using GitQL SDK

  • LLQL: Tool to run SQL query on LLVM IR/BC and perform Pattern matching on instructions.
  • ClangQL: Tool to run SQL query on C/C++ Source code files.
  • FileQL Tool to run SQL query on file systems and extract metadata.
  • PyQL Tool to run SQL query on Python Source code files.

License

MIT License

Copyright (c) 2023 - 2025 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.

Extension points exported contracts — how you extend this code

DataType (Interface)
The in memory representation of the Data type in the GitQL query engine [20 implementers]
crates/gitql-ast/src/types/base.rs
Value (Interface)
The in memory representation of the Values in the GitQL query engine [14 implementers]
crates/gitql-core/src/values/base.rs
BaseOutputPrinter (Interface)
(no doc) [4 implementers]
crates/gitql-cli/src/printer/mod.rs
DataProvider (Interface)
DataProvider is a component that used to provide and map the data to the GitQL Engine User should implement [`DataProvi [1 …
crates/gitql-engine/src/data_provider.rs
Expr (Interface)
(no doc) [32 implementers]
crates/gitql-ast/src/expression.rs

Core symbols most depended-on inside this repo

len
called by 271
crates/gitql-core/src/object.rs
as_boxed
called by 200
crates/gitql-parser/src/diagnostic.rs
with_location
called by 198
crates/gitql-parser/src/diagnostic.rs
as_any
called by 74
crates/gitql-ast/src/types/row.rs
add_help
called by 68
crates/gitql-parser/src/diagnostic.rs
contains
called by 64
crates/gitql-core/src/environment.rs
expr_type
called by 62
crates/gitql-ast/src/expression.rs
advance
called by 61
crates/gitql-parser/src/tokenizer.rs

Shape

Method 733
Function 363
Class 115
Enum 26
Interface 5

Languages

Rust100%

Modules by API surface

crates/gitql-ast/src/types/base.rs85 symbols
crates/gitql-parser/src/parser.rs69 symbols
crates/gitql-core/src/values/base.rs67 symbols
crates/gitql-ast/src/expression.rs44 symbols
crates/gitql-ast/src/types/integer.rs43 symbols
crates/gitql-core/src/values/integer.rs34 symbols
crates/gitql-engine/src/engine_evaluator.rs32 symbols
crates/gitql-std/src/text/mod.rs30 symbols
crates/gitql-std/src/datetime/mod.rs27 symbols
crates/gitql-core/src/values/boolean.rs27 symbols
crates/gitql-ast/src/types/float.rs27 symbols
crates/gitql-ast/src/types/boolean.rs27 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add GQL \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact