Skip to content

Commit

Permalink
Add circleci (eatonphil#9)
Browse files Browse the repository at this point in the history
* Add .circleci/config.yml

* Add build step and go 1.14

* Test build failure

* Add circleci badge to readme

* Reset cmd/main.go
  • Loading branch information
eatonphil authored Apr 15, 2020
1 parent da63063 commit 1250f83
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.14

working_directory: /go/src/github.com/eatonphil/gosql
steps:
- checkout

- run: go get -v -t -d ./...
- run: go test -v ./...
- run: go build cmd/main.go
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

An early PostgreSQL implementation in Go.

[![gosql](https://circleci.com/gh/eatonphil/gosql.svg?style=svg)](https://circleci.com/gh/eatonphil/gosql)

## Example

```bash
Expand Down
12 changes: 0 additions & 12 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"io"
"os"
"strings"

"github.com/eatonphil/gosql"

Expand Down Expand Up @@ -101,11 +100,6 @@ repl:
continue repl
}

trimmedLine := strings.TrimRight(line, " ")
if trimmedLine == "quit" || trimmedLine == "exit" || strings.TrimLeft(trimmedLine, " ") == "\\q" {
break
}

ast, err := gosql.Parse(line)
if err != nil {
fmt.Println("Error while parsing:", err)
Expand All @@ -120,12 +114,6 @@ repl:
fmt.Println("Error creating table", err)
continue repl
}
case gosql.DropTableKind:
err = mb.DropTable(ast.Statements[0].DropTableStatement)
if err != nil {
fmt.Println("Error dropping table", err)
continue repl
}
case gosql.InsertKind:
err = mb.Insert(stmt.InsertStatement)
if err != nil {
Expand Down

0 comments on commit 1250f83

Please sign in to comment.