Skip to content

A MySQL-compatible relational database with a storage agnostic query engine. Implemented in pure Go.

License

Notifications You must be signed in to change notification settings

jercheng/go-mysql-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codebeat badge

Build Status

codecov

GoDoc

Installation

Check the Releases page to download the gitql binary.

Usage

Usage:
  gitql [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
$ 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      |
+------------------------------------------+---------------------+-----------------------+
| 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:

$ gitql 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

gitql exposes the following tables:

Name Columns
commits hash, author_name, author_email, author_time, comitter_name, comitter_email, comitter_time, message
blobs hash, size
references hash,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

We are continuously adding more functionality to gitql. 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

gitql is licensed under the MIT License.

About

A MySQL-compatible relational database with a storage agnostic query engine. Implemented in pure Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.9%
  • Python 0.1%
  • Shell 0.0%
  • Java 0.0%
  • Makefile 0.0%
  • C 0.0%