Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hexdigest committed Dec 18, 2017
1 parent 4bf98df commit 51879b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# prep [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/hexdigest/prep/blob/master/LICENSE) [![Build Status](https://travis-ci.org/hexdigest/prep.svg?branch=master)](https://travis-ci.org/hexdigest/prep) [![Coverage Status](https://coveralls.io/repos/github/hexdigest/prep/badge.svg?branch=master)](https://coveralls.io/github/hexdigest/prep?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/hexdigest/prep)](https://goreportcard.com/report/github.com/hexdigest/prep)
# Prep [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/hexdigest/prep/blob/master/LICENSE) [![Build Status](https://travis-ci.org/hexdigest/prep.svg?branch=master)](https://travis-ci.org/hexdigest/prep) [![Coverage Status](https://coveralls.io/repos/github/hexdigest/prep/badge.svg?branch=master)](https://coveralls.io/github/hexdigest/prep?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/hexdigest/prep)](https://goreportcard.com/report/github.com/hexdigest/prep)
Prep finds all SQL statements in a Go package and instruments db connection with prepared statements

# Usage
Expand All @@ -23,7 +23,7 @@ func main() {

Generate a list of the SQL statements used in your package:

```
```bash
$ prep -f github.com/hexdigest/prepdemo
$ cat prepared_statements.go
```
Expand Down Expand Up @@ -59,14 +59,15 @@ func main() {
}
fmt.Println(s)
}
```

Take a look at the line:
```go
db, err := prep.NewConnection(sqlDB, prepStatements)
```

It instruments your connection with prepared statements found by the generator.
It also instruments generated code with the go:generate instruction so in order to update statements list you can simply run:
The generated code already contains //go:generate instruction, so in order to update the statements list you can simply run:

```bash
$ go generate
Expand Down

0 comments on commit 51879b6

Please sign in to comment.