diff --git a/README.md b/README.md index 460f35b..985f162 100644 --- a/README.md +++ b/README.md @@ -47,17 +47,27 @@ if err != nil { panic(err) } -fmt.Printf("query:\n%v", query) -fmt.Printf("args:\n%v", args) +debug := q.DebugBuild() + +fmt.Println("query:") +fmt.Println(query) +fmt.Println("\nargs:") +fmt.Println(args) +fmt.Println("\ndebug:") +fmt.Println(debug) -// Output: -// // query: // SELECT foo, bar FROM users // WHERE active IS TRUE // AND user_id = $1 OR user = $2 +// // args: // [42 root] +// +// debug: +// SELECT foo, bar FROM 'users' +// WHERE active IS TRUE +// AND user_id = 42 OR user = 'root' ``` See examples: [example_test.go](example_test.go). diff --git a/example_test.go b/example_test.go index 16689e7..6011b4b 100644 --- a/example_test.go +++ b/example_test.go @@ -45,9 +45,9 @@ func ExampleNew() { fmt.Println("query:") fmt.Println(query) - fmt.Println("args:") + fmt.Println("\nargs:") fmt.Println(args) - fmt.Println("debug:") + fmt.Println("\ndebug:") fmt.Println(debug) // Output: @@ -56,8 +56,10 @@ func ExampleNew() { // SELECT foo, bar FROM users // WHERE active IS TRUE // AND user_id = $1 OR user = $2 + // // args: // [42 root] + // // debug: // SELECT foo, bar FROM 'users' // WHERE active IS TRUE