diff --git a/README.md b/README.md index c32b889..6e32f93 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` @@ -59,6 +59,7 @@ func main() { } fmt.Println(s) } +``` Take a look at the line: ```go @@ -66,7 +67,7 @@ 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