Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
amirrezaask committed Mar 9, 2022
1 parent 0ea025a commit 137a638
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ orm.Save(&User{ID: 1, Name: "Amirreza2"}) // UPDATE users SET name=? WHERE id=?,
```
also you can do custom update queries using again query builder or raw sql as well.
```go
res, err := orm.Query[User]().Set("name", "amirreza2").Where("id", 1).Execute()
res, err := orm.Query[User]().Set("name", "amirreza2").Where("id", 1).Update()
```

using raw sql
Expand All @@ -161,9 +161,9 @@ err := orm.Delete(user)
```
you can also use query builder or raw sql.
```go
_, affected, err := orm.Query[Post]().WherePK(1).Delete().Execute()
_, affected, err := orm.Query[Post]().WherePK(1).Delete()

_, affected, err := orm.Query[Post]().Where("id", 1).Delete().Execute()
_, affected, err := orm.Query[Post]().Where("id", 1).Delete()

```
```go
Expand Down

0 comments on commit 137a638

Please sign in to comment.