gitql

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2017 License: MIT Imports: 4 Imported by: 0

README

gitql

Build Status codecov GoDoc

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   | user1@test.io |
| 034cb63f77f4a0d30d26dabb999d348be6640df7 | Antonio J. Navarro | user2@test.io |
+------------------------------------------+--------------------+---------------+

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Catalog  *sql.Catalog
	Analyzer *analyzer.Analyzer
}

func New

func New() *Engine

func (*Engine) AddDatabase

func (e *Engine) AddDatabase(db sql.Database)

func (*Engine) Query

func (e *Engine) Query(query string) (sql.Schema, sql.RowIter, error)

Directories

Path Synopsis
cmd
internal
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL