Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario L Gutierrez committed Jun 26, 2015
2 parents fdd52cd + 6cad7ac commit da5d9aa
Show file tree
Hide file tree
Showing 56 changed files with 1,592 additions and 954 deletions.
12 changes: 11 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Changes from legacy to v1
## v1.1.0

* [Caching](https://github.com/mgutz/dat#caching) - caching with Redis or (in-memory for testing)
* [LogQueriesThreshold](https://github.com/mgutz/dat#tracing-sql) - log slow queries
* dat.Null* creators
* fix resource cleanup
* fix duplicate error logging
* include RFC339Nano in NullTime parsing
* HUGE BUG in remapPlaceholders

## v1.0.0

* Original dat moved to legacy branch.

Expand Down
6 changes: 3 additions & 3 deletions Gododir/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ package dat
func generateTasks(p *do.Project) {
p.Task("builder-boilerplate", nil, func(c *do.Context) {
context := do.M{
"builders": []string{"DeleteBuilder", "InsectBuilder",
"builders": []string{"CallBuilder", "DeleteBuilder", "InsectBuilder",
"InsertBuilder", "RawBuilder", "SelectBuilder", "SelectDocBuilder",
"UpdateBuilder", "UpsertBuilder"},
}

s, err := util.StrTemplate(builderTemplate, context)
c.Check(err, "Unalbe ")

ioutil.WriteFile("v1/builders_generated.go", []byte(s), 0644)
c.Run("go fmt v1/builders_generated.go")
ioutil.WriteFile("builders_generated.go", []byte(s), 0644)
c.Run("go fmt builders_generated.go")
}).Desc("Generates builder boilerplate code")
}
42 changes: 41 additions & 1 deletion Gododir/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"fmt"

_ "github.com/lib/pq"
do "gopkg.in/godo.v2"
)
Expand All @@ -16,9 +18,16 @@ func tasks(p *do.Project) {
p.Task("createdb", nil, createdb).Description("Creates test database")

p.Task("test", nil, func(c *do.Context) {
c.Run(`go test -race`)
c.Run(`go test -race`, do.M{"$in": "sqlx-runner"})
}).Src("**/*.go").
Desc("test with -race flag")

p.Task("test-fast", nil, func(c *do.Context) {
c.Run(`go test`)
c.Run(`go test`, do.M{"$in": "sqlx-runner"})
}).Src("**/*.go")
}).Src("**/*.go").
Desc("fater test without -race flag")

p.Task("test-dir", nil, func(c *do.Context) {
dir := c.Args.NonFlags()[0]
Expand All @@ -36,6 +45,10 @@ func tasks(p *do.Project) {
`)
})

p.Task("hello", nil, func(*do.Context) {
fmt.Println("hello?")
})

p.Task("bench", nil, func(c *do.Context) {
// Bash("go test -bench . -benchmem 2>/dev/null | column -t")
// Bash("go test -bench . -benchmem 2>/dev/null | column -t", In{"sqlx-runner"})
Expand All @@ -62,6 +75,33 @@ func tasks(p *do.Project) {

p.Task("example", nil, func(c *do.Context) {
})

p.Task("lint", nil, func(c *do.Context) {
c.Bash(`
echo Directory=.
golint
cd sqlx-runner
echo
echo Directory=sqlx-runner
golint
cd ../kvs
echo
echo Directory=kvs
golint
cd ../postgres
echo
echo Directory=postgres
golint
`)
})

p.Task("mocks", nil, func(c *do.Context) {
// go get github.com/vektra/mockery
c.Run("mockery --dir=kvs --all")
})
}

func main() {
Expand Down
2 changes: 1 addition & 1 deletion Gododir/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func createdb(c *Context) {
if err != nil {
panic(err)
}
_, err = db.Exec("create extension hstore")
_, err = db.Exec("create extension if not exists hstore")
if err != nil {
panic(err)
}
Expand Down
Loading

0 comments on commit da5d9aa

Please sign in to comment.