MCPcopy Index your code
hub / github.com/filhodanuvem/gitql

github.com/filhodanuvem/gitql @v2.3.1 sqlite

repository ↗ · DeepWiki ↗ · release v2.3.1 ↗
327 symbols 1,159 edges 24 files 23 documented · 7%
README

Gitql Go Report Card Open Source Helpers License MIT ===============

Gitql is a Git query language.

In a repository path...

how to use

See more here

Reading the code

⚠️ Gitql is my first golang project. If you are a beginner looking for using the project as a guideline (how to organise or make an idiomatic go code), I recommend you polyglot instead.

Requirements

  • Go 1.16+

How to install

You can access the releases page and just grab the binary. If you want to compile itself just run go build ..

Examples

gitql "your query"
or
git ql "your query"

As an example, this is the commits table:

commits
author
author_email
committer
committer_email
hash
date
message
full_message

(see more tables here)

Example Commands

  • select hash, author, message from commits limit 3
  • select hash, message from commits where 'hell' in full_message or 'Fuck' in full_message
  • select hash, message, author_email from commits where author = 'cloudson'
  • select date, message from commits where date < '2014-04-10'
  • select message from commits where 'hell' in message order by date asc
  • select distinct author from commits where date < '2020-01-01'

Questions?

gitql or open an issue

Notes: * Gitql doesn't want to kill git log - it was created just for science! :sweat_smile: * It's read-only - no deleting, inserting, or updating tables or commits. :stuck_out_tongue_closed_eyes: * The default limit is 10 rows. * It's inspired by textql. * Gitql is a compiler/interpreter instead of just read a sqlite database with all commits, tags, etc. because we would need to sync the tables every time before run sql and we would have sqlite bases for each repository. :neutral_face:

Extension points exported contracts — how you extend this code

NodeExpr (Interface)
(no doc) [11 implementers]
parser/ast.go
Visitor (Interface)
(no doc) [1 implementers]
semantical/visitor.go

Core symbols most depended-on inside this repo

New
called by 61
parser/parser.go
AST
called by 60
parser/parser.go
Token
called by 56
lexical/lexical.go
nextChar
called by 44
lexical/lexical.go
Error
called by 29
parser/parser.go
Value
called by 27
parser/ast.go
RightValue
called by 21
parser/ast.go
LeftValue
called by 20
parser/ast.go

Shape

Function 169
Method 125
Struct 27
Interface 5
TypeAlias 1

Languages

Go100%

Modules by API surface

parser/ast.go112 symbols
parser/parser_test.go42 symbols
runtime/runtime.go27 symbols
parser/parser.go23 symbols
lexical/lexical_test.go19 symbols
runtime/visitor.go14 symbols
semantical/semantical_test.go13 symbols
semantical/semantical.go11 symbols
semantical/visitor.go10 symbols
runtime/commits_test.go9 symbols
runtime/runtime_test.go8 symbols
lexical/lexical.go8 symbols

Dependencies from manifests, versioned

github.com/chzyer/logexv1.1.10 · 1×
github.com/chzyer/readlinev0.0.0-2018060313265 · 1×
github.com/chzyer/testv0.0.0-2018021303581 · 1×

For agents

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

⬇ download graph artifact