From 87702f58dab125be0c64bc5e372d722a7c33aecd Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 24 Jun 2025 23:13:23 +0200 Subject: [PATCH] add gitql --- technology/applications/Applications.md | 1 + technology/dev/gitql.md | 48 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 technology/dev/gitql.md diff --git a/technology/applications/Applications.md b/technology/applications/Applications.md index 7d552e6..641a5c4 100644 --- a/technology/applications/Applications.md +++ b/technology/applications/Applications.md @@ -297,6 +297,7 @@ rev: 2025-01-30 - [tokei](./cli/tokei.md) - [gum](./cli/gum.md) - [git](../dev/Git.md) +- [gitql](../dev/gitql.md) - [Ansible](../tools/Ansible/Ansible.md) - [Docker](../tools/Docker.md) - [Podman](../tools/Podman.md) diff --git a/technology/dev/gitql.md b/technology/dev/gitql.md new file mode 100644 index 0000000..3ffa404 --- /dev/null +++ b/technology/dev/gitql.md @@ -0,0 +1,48 @@ +--- +obj: application +website: https://amrdeveloper.github.io/GQL/ +repo: https://github.com/amrdeveloper/GQL +--- + +# GitQL +GQL is a query language with a syntax very similar to SQL with a tiny engine to perform queries on `.git` files instance of database files, the engine executes the query on the fly without the need to create database files or convert `.git` files into any other format, note that all Keywords in GQL are case-insensitive similar to SQL. + +## Examples + +```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' + +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 +```