diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1b1f8c3 --- /dev/null +++ b/.circleci/config.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index fdf9699..a7f17c8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cmd/main.go b/cmd/main.go index 07e65e6..1978f4a 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,7 +4,6 @@ import ( "fmt" "io" "os" - "strings" "github.com/eatonphil/gosql" @@ -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) @@ -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 {