Skip to content

rename to gitquery, closes #83 #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ matrix:
before_install:
- rm -rf $GOPATH/src/gopkg.in/sqle
- mkdir -p $GOPATH/src/gopkg.in/sqle
- ln -s $PWD $GOPATH/src/gopkg.in/sqle/gitql.v0
- cd $GOPATH/src/gopkg.in/sqle/gitql.v0
- ln -s $PWD $GOPATH/src/gopkg.in/sqle/gitquery.v0
- cd $GOPATH/src/gopkg.in/sqle/gitquery.v0
- go get -t -v ./...
install:
- go build -ldflags="-X main.version=$TRAVIS_TAG" -v -o gitql ./cmd/...
- go build -ldflags="-X main.version=$TRAVIS_TAG" -v -o gitquery ./cmd/...
script:
- sh ./go.test.sh
after_success:
Expand All @@ -24,7 +24,7 @@ deploy:
provider: releases
api_key:
secure: YUASK1+EaHQo1WPIDfSQZLynvPh/bFPVV8WNrbqWkqox+Y58MLeYCEGnDjP70pVsL5YmjZzeEGv4XRYIl359wqL7YxnB70mJGAmbi8xQ8DS+ecbpJXz+kDES/QqX6BVJYXMWRm2hM/XdyIDvPa5kaVBbeFlO86uizI0OSHE/2O4aticeaRUajTM+Bv7/R2ygVCiB+1gVdGqPmRy2w/bFUOAfR1LTC8TLDQFJUvgjtuJJVKhffKhcqfnibNyBtTEd9nwSuY4MAuva9ghgFvl1B9uJ266ktEDkqAjNX3Cg1UNyAPXs50M61gBUEFV/MAscCHrtHDdtzyrKPaUZ224TcTVjgEZiOG8Zus+0wvwyhf7wyxSHx73ZXGedu54/oazLqFudj9u2AM+qMrXoRtFcygtSXBdG4SaN0OL/EUXnxiJLPbfFT/oM7VpdEscZn8okMo7RtbGxszrJQOIvrcNd16IZHK10S/nVnGNHNNNuArwf5B15DK49gveB1+sv/8FkoTx3LXJFHHiA1C8l5sH+Of6v/YKa5Zspkub7wkKrE3fQ/zPc3D0AVvrMt/k6S0LBtQR6eJqqtasVLlmtrRujyOxWLWO7fwmRTsI6qT1O4fspGBaONg8cr9xuwsOGBcGIEaPCKv3RZrY8+hx2J7cLzV0qjaJtmucamnenxic7a6o=
file: gitql
file: gitquery
skip_cleanup: true
on:
tags: true
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<p align="center">
<img src="https://rawgit.com/sqle/gitql/master/gitql-logo.svg">
</p>

<p align="center">
# gitquery

<p>
<a href="https://codebeat.co/projects/gb.xjqchip.workers.dev-sqle-gitql"><img alt="codebeat badge" src="https://codebeat.co/badges/d797a013-326b-4686-a1a7-adcb3039f65c" /></a>

<a href="https://travis-ci.org/sqle/gitql"><img alt="Build Status" src="https://travis-ci.org/sqle/gitql.svg?branch=master" /></a>
<a href="https://travis-ci.org/sqle/gitquery"><img alt="Build Status" src="https://travis-ci.org/sqle/gitquery.svg?branch=master" /></a>

<a href="https://codecov.io/gh/sqle/gitql"><img alt="codecov" src="https://codecov.io/gh/sqle/gitql/branch/master/graph/badge.svg" /></a>
<a href="https://codecov.io/gh/sqle/gitquery"><img alt="codecov" src="https://codecov.io/gh/sqle/gitquery/branch/master/graph/badge.svg" /></a>

<a href="https://godoc.org/gopkg.in/sqle/gitql.v0"><img alt="GoDoc" src="https://godoc.org/gopkg.in/sqle/gitql.v0?status.svg" /></a>
<a href="https://godoc.org/gopkg.in/sqle/gitquery.v0"><img alt="GoDoc" src="https://godoc.org/gopkg.in/sqle/gitquery.v0?status.svg" /></a>
</p>

<a href="https://asciinema.org/a/102733?autoplay=1" target="_blank"><img src="https://asciinema.org/a/102733.png" width="979"/></a>

## Installation

Check the [Releases](https://github.com/sqle/gitql/releases) page to download
the gitql binary.
Check the [Releases](https://github.com/sqle/gitquery/releases) page to download
the gitquery binary.

## Usage

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

Help Options:
-h, --help Show this help message
Expand All @@ -39,7 +36,7 @@ For example:

```bash
$ cd my_git_repo
$ gitql query 'SELECT hash, author_email, author_name FROM commits LIMIT 2;'
$ 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 |
Expand All @@ -52,7 +49,7 @@ SELECT hash, author_email, author_name FROM commits LIMIT 2;
You can use the interactive shell like you usually do to explore tables in postgreSQL per example:

```bash
$ gitql shell
$ gitquery shell

gitQL SHELL
-----------
Expand All @@ -73,7 +70,7 @@ You must end your queries with ';'

## Tables

gitql exposes the following tables:
gitquery exposes the following tables:

| Name | Columns |
|:------------:|:---------------------------------------------------------------------------------------------------:|
Expand All @@ -85,7 +82,7 @@ gitql exposes the following tables:

## SQL syntax

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

| | Supported |
|:----------------------:|:---------------------------------------------------------------------------------:|
Expand All @@ -96,4 +93,4 @@ We are continuously adding more functionality to gitql. We support a subset of t

## License

gitql is licensed under the [MIT License](https://github.com/sqle/gitql/blob/master/LICENSE).
gitquery is licensed under the [MIT License](https://github.com/sqle/gitquery/blob/master/LICENSE).
2 changes: 1 addition & 1 deletion blobs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"gopkg.in/sqle/sqle.v0/sql"
Expand Down
2 changes: 1 addition & 1 deletion blobs_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"testing"
Expand Down
6 changes: 5 additions & 1 deletion cmd/gitql/main.go → cmd/gitquery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import (
"github.com/jessevdk/go-flags"
)

const (
name = "gitquery"
)

func main() {
parser := flags.NewNamedParser("gitql", flags.Default)
parser := flags.NewNamedParser(name, flags.Default)
parser.AddCommand("query", "Execute a SQL query a repository.", "", &CmdQuery{})
parser.AddCommand("shell", "Start an interactive session.", "", &CmdShell{})
parser.AddCommand("version", "Show the version information.", "", &CmdVersion{})
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions cmd/gitql/query_base.go → cmd/gitquery/query_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"path/filepath"

"gopkg.in/sqle/gitql.v0"
"gopkg.in/sqle/gitql.v0/internal/format"
"gopkg.in/sqle/gitquery.v0"
"gopkg.in/sqle/gitquery.v0/internal/format"
"gopkg.in/sqle/sqle.v0"

gogit "srcd.works/go-git.v4"
Expand All @@ -32,7 +32,7 @@ func (c *cmdQueryBase) buildDatabase() error {
}

c.name = filepath.Base(filepath.Join(c.Path, ".."))
sqle.DefaultEngine.AddDatabase(gitql.NewDatabase(c.name, r))
sqle.DefaultEngine.AddDatabase(gitquery.NewDatabase(c.name, r))
c.db, err = sql.Open(sqle.DriverName, "")
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/gitql/shell.go → cmd/gitquery/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func (c *CmdShell) Execute(args []string) error {

rl, err := readline.NewEx(&readline.Config{
Prompt: prompt,
HistoryFile: "/tmp/gitql-history",
HistoryFile: fmt.Sprintf("/tmp/%s-history", name),
DisableAutoSaveHistory: true,
})
if err != nil {
return err
}

fmt.Println(" ", white("git")+blue("QL"), "SHELL")
fmt.Println(" ", white("git")+blue("query"), "shell")
fmt.Println(" -----------")
fmt.Println("You must end your queries with ';'")
fmt.Println("")
Expand Down
2 changes: 1 addition & 1 deletion cmd/gitql/version.go → cmd/gitquery/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var build string
type CmdVersion struct{}

func (c *CmdVersion) Execute(args []string) error {
fmt.Printf("gitql (%s) - build %s\n", version, build)
fmt.Printf("%s (%s) - build %s\n", name, version, build)

return nil
}
2 changes: 1 addition & 1 deletion commits.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"gopkg.in/sqle/sqle.v0/sql"
Expand Down
2 changes: 1 addition & 1 deletion commits_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion database.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"gopkg.in/sqle/sqle.v0/sql"
Expand Down
2 changes: 1 addition & 1 deletion database_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"sort"
Expand Down
9 changes: 0 additions & 9 deletions gitql-logo.svg

This file was deleted.

2 changes: 1 addition & 1 deletion objects.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"gopkg.in/sqle/sqle.v0/sql"
Expand Down
2 changes: 1 addition & 1 deletion objects_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion references.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"gopkg.in/sqle/sqle.v0/sql"
Expand Down
2 changes: 1 addition & 1 deletion references_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion tags.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"gopkg.in/sqle/sqle.v0/sql"
Expand Down
2 changes: 1 addition & 1 deletion tags_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion tree_entries.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"strconv"
Expand Down
2 changes: 1 addition & 1 deletion tree_entries_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gitql
package gitquery

import (
"testing"
Expand Down