Skip to content
forked from src-d/gitbase

SQL interface to Git repositories, written in Go.

License

Notifications You must be signed in to change notification settings

drsect0r/gitql

Repository files navigation

gitql

Build StatuscodecovGoDoc

gitql is a SQL interface to Git repositories, written in Go.

WARNING: gitql is still in a very early stage of development. It is considered experimental.

Installation

Check the Releases page to download the gitql binary.

Usage

Usage: gitql [OPTIONS] <query | version> Help Options: -h, --help Show this help message Available commands: query Execute a SQL query a repository. version Show the version information. 

For example:

$ cd my_git_repo $ gitql 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 | +------------------------------------------+--------------------+---------------+ | 02e0aa0ef807d2ae4d02ecdbe37681db9e812544 | Santiago M. Mola |[email protected]|| 034cb63f77f4a0d30d26dabb999d348be6640df7 | Antonio J. Navarro |[email protected]| +------------------------------------------+--------------------+---------------+

Tables

gitql exposes the following tables:

  • commits (hash, author_name, author_email, author_time, comitter_name, comitter_email, comitter_time, message)
  • blobs (hash, size)
  • references (hash, name, is_branch, is_note, is_remote, is_tag, target)
  • tags (hash, name, tagger_email, tagger_name, tagger_when, message, target)
  • tree_entries (tree_hash, entry_hash, mode, name)

SQL syntax

gitql supports a subset of the SQL standard, currently including:

  • SELECT
  • WHERE
  • ORDER BY (with ASC and DESC)
  • LIMIT
  • GROUP BY (with COUNT and FIRST)
  • SHOW TABLES
  • DESCRIBE TABLE

License

gitql is licensed under the MIT License.

About

SQL interface to Git repositories, written in Go.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go99.8%
  • Shell0.2%