Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AmrDeveloper/GQL
Git Query language is a SQL like language to perform queries on .git files with supports of most of SQL features such as grouping, ordering and aggregations functions
https://github.com/AmrDeveloper/GQL
database engine git gitql gql interpreter rust sql
Last synced: about 1 month ago
JSON representation
Git Query language is a SQL like language to perform queries on .git files with supports of most of SQL features such as grouping, ordering and aggregations functions
- Host: GitHub
- URL: https://github.com/AmrDeveloper/GQL
- Owner: AmrDeveloper
- License: mit
- Created: 2023-06-05T17:46:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-22T17:28:34.000Z (7 months ago)
- Last Synced: 2024-05-22T17:45:28.010Z (7 months ago)
- Topics: database, engine, git, gitql, gql, interpreter, rust, sql
- Language: Rust
- Homepage: https://amrdeveloper.github.io/GQL/
- Size: 5.91 MB
- Stars: 3,060
- Watchers: 9
- Forks: 87
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
GQL - Git Query Language
GQL is a query language with a syntax very similar to SQL with a tiny engine to perform queries on .git files instead 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.
---
### Samples
Note that all Keywords in GQL are case-insensitive, similar to SQL.
```sql
SELECT 1
SELECT 1 + 2
SELECT LEN("Git Query Language")
SELECT "One" IN ("One", "Two", "Three")
SELECT "Git Query Language" LIKE "%Query%"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 .. 10SELECT * FROM refs WHERE type = "branch"
SELECT * FROM refs ORDER BY typeSELECT * 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 name LIKE "%gmail%" ORDER BY author_name
SELECT * FROM commits WHERE LOWER(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 branchesSELECT * FROM tags
SELECT * FROM tags OFFSET 1 LIMIT 1
```---
## Documentation:
- [Full Documentation](https://amrdeveloper.github.io/GQL/)
- [Install or Build](docs/setup.md)
- [Tables](docs/structure/tables.md)
- [Types](docs/structure/types.md)
- [Statements](docs/statement)
- [Expressions](docs/expression)
- [Functions and Operators](docs/functions)
- [Aggregations](docs/function/aggregations.md)
- [GitQL SDK](docs/sdk.md)---
### License
```
MIT LicenseCopyright (c) 2023 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.
```