Giter VIP home page Giter VIP logo

gitquery's Introduction

gitquery

codebeat badge

Build Status

codecov

GoDoc

Installation

Check the Releases page to download the gitquery binary.

Usage

Usage:
  gitquery [OPTIONS] <query | shell | version>

Help Options:
  -h, --help  Show this help message

Available commands:
  query    Execute a SQL query a repository.
  shell    Start an interactive session.
  version  Show the version information.

For example:

$ cd my_git_repo
$ gitquery query 'SELECT hash, author_email, author_name FROM commits LIMIT 2;' 
SELECT hash, author_email, author_name FROM commits LIMIT 2;
+------------------------------------------+---------------------+-----------------------+
|                   HASH                   |    AUTHOR EMAIL     |      AUTHOR NAME      |
+------------------------------------------+---------------------+-----------------------+
| 003dc36e0067b25333cb5d3a5ccc31fd028a1c83 | [email protected]       | Santiago M. Mola      |
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected]       | Antonio Navarro Perez |
+------------------------------------------+---------------------+-----------------------+

You can use the interactive shell like you usually do to explore tables in postgreSQL per example:

$ gitquery shell

           gitQL SHELL
           -----------
You must end your queries with ';'

!> SELECT hash, author_email, author_name FROM commits LIMIT 2;

--> Executing query: SELECT hash, author_email, author_name FROM commits LIMIT 2;

+------------------------------------------+---------------------+-----------------------+
|                   HASH                   |    AUTHOR EMAIL     |      AUTHOR NAME      |
+------------------------------------------+---------------------+-----------------------+
| 003dc36e0067b25333cb5d3a5ccc31fd028a1c83 | [email protected]       | Santiago M. Mola      |
| 01ace9e4d144aaeb50eb630fed993375609bcf55 | [email protected]       | Antonio Navarro Perez |
+------------------------------------------+---------------------+-----------------------+
!>  

Tables

gitquery exposes the following tables:

Name Columns
commits hash, author_name, author_email, author_time, comitter_name, comitter_email, comitter_time, message
blobs hash, size
refs name, type, hash, target, is_branch, is_note, is_remote, is_tag
tags hash, name, tagger_email, tagger_name, tagger_when, message, target
tree_entries tree_hash, entry_hash, mode, name

SQL syntax

We are continuously adding more functionality to gitquery. We support a subset of the SQL standard, currently including:

Supported
Comparison expressions !=, ==, >, <, >=,<=
Grouping expressions COUNT, FIRST
Standard expressions ALIAS, LITERAL, STAR (*)
Statements CROSS JOIN, DESCRIBE, FILTER (WHERE), GROUP BY, LIMIT, SELECT, SHOW TABLES, SORT

License

gitquery is licensed under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.