Skip to content

Commit

Permalink
chore(docs): updating the readme examples (#61)
Browse files Browse the repository at this point in the history
updating the readme examples
  • Loading branch information
Jacobbrewer1 authored Oct 28, 2024
1 parent 104d38e commit 960f940
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,8 @@ func main() {
panic(err)
}

// Output:
// UPDATE people
// SET name = ?
// WHERE (1 = 1)
// AND (
// id = ?
// )
fmt.Println(sqlStr)

// Output:
// ["John", 1]

fmt.Println(args)
}

Expand All @@ -84,8 +75,7 @@ This will output:

```sql
UPDATE people
SET name = ?,
age = ?
SET name = ?
WHERE (1 = 1)
AND (
id = ?
Expand All @@ -95,7 +85,7 @@ WHERE (1 = 1)
with the args:

```
["John", 25, 1]
["john", 1]
```

#### Struct diffs
Expand Down Expand Up @@ -142,11 +132,6 @@ func main() {
panic(err)
}

// Output:
// 6
// Old Text
// PrePopulated
// New Text
fmt.Println(s.Number)
fmt.Println(s.Text)
fmt.Println(s.PrePopulated)
Expand All @@ -155,6 +140,15 @@ func main() {

```

This will output:

```
6
Hello
PrePopulated
New Text
```

If you would like to generate an update script from two structs, you can use the `NewDiffSQLPatch` function. This
function will generate an update script from the two structs.

Expand Down

0 comments on commit 960f940

Please sign in to comment.