Skip to content

Commit 2ae7d17

Browse files
authored
Merge pull request #350 from mattias-lundell/patch-1
Update README.md
2 parents 3909563 + b5e1652 commit 2ae7d17

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,14 +732,18 @@ Raw SQL strings passed to `Exec`, `Select`, `SelectOne`, `SelectInt`,
732732
etc will not be parsed. Consequently you may have portability issues
733733
if you write a query like this:
734734

735-
```go // works on MySQL and Sqlite3, but not with Postgresql err :=
736-
dbmap.SelectOne(&val, "select * from foo where id = ?", 30) ```
735+
```go
736+
// works on MySQL and Sqlite3, but not with Postgresql err :=
737+
dbmap.SelectOne(&val, "select * from foo where id = ?", 30)
738+
```
737739

738740
In `Select` and `SelectOne` you can use named parameters to work
739741
around this. The following is portable:
740742

741-
```go err := dbmap.SelectOne(&val, "select * from foo where id = :id",
742-
map[string]interface{} { "id": 30}) ```
743+
```go
744+
err := dbmap.SelectOne(&val, "select * from foo where id = :id",
745+
map[string]interface{} { "id": 30})
746+
```
743747

744748
Additionally, when using Postgres as your database, you should utilize
745749
`$1` instead of `?` placeholders as utilizing `?` placeholders when

0 commit comments

Comments
 (0)