Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
anton7r committed Mar 19, 2021
1 parent a313020 commit d20c6b6
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,43 @@

![Coverage](./coverage_badge.png)

Extends from the jackc/pgx library
Utilizes the pgx library under the hood to achieve fast performance
Extends from the jackc/pgx library.

Utilizes the pgx library under the hood to achieve fast performance.

It also uses a modified fork of scany (`github.com/anton7r/pgx-scany` which removes unneccessary imports) to scan database rows into structs.

## Features

- Simplified SQLX like API
- Named Queries Supported

## Code example

The code example is not guranteed to have correct syntax, so if you spot a mistake please file an issue :)

```go
import "github.com/anton7r/pgxe"

type Product struct {
Id int
Name string
Price decimal??
}

func main() {
db := pgxe.Connect(pgxe.Connection{
User: "admin",
Password: "superSecretPassword",
DbName: "postgres",
DbPort: "5432",
})

query := "SELECT * FROM products WHERE id = :id"
rows, err := db.NamedQuery(query, &Product{Id:4})
if err != nil {
println(err.Error())
return
}
}
```

0 comments on commit d20c6b6

Please sign in to comment.