Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ax4w authored Dec 9, 2023
1 parent 300ca4d commit 97d0f2e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ The Gorage instance is **not** saved to a file.
Open Gorage by path
### CreateTable
> `g := OpenGorage("./test.json")`
> `g := Open("./test.json")`
>
> `table := g.CreateTable("Example")`
1. Open Gorage

### AddColumn

```go
g := OpenGorage("./test.json")
g := Open("./test.json")
table := g.CreateTable("User")
if table != nil {
table.AddColumn("FirstName", STRING).
Expand Down Expand Up @@ -134,14 +134,14 @@ William | 22 | USA

#### Select
```go
g := OpenGorage("./test.json")
g := Open("./test.json")
userTable := g.FromTable("User").Where(":Name == 'William' && :Country == 'USA' ").Select([]string{"Name", "Age"})
g.Close()
```

### Update
```go
g := OpenGorage("./test.json")
g := Open("./test.json")
g.FromTable("User").Where(":Name == 'William' && :Age == 20").Update(map[string]interface{}{
"Name": "Tom"
})
Expand All @@ -151,14 +151,14 @@ g.Close()

#### Delete
```go
g := OpenGorage("./test.json")
g := Open("./test.json")
g.FromTable("User").Where(":Name == 'William' && :Age == 20").Delete()
g.Close()
```

#### Insert
```go
g := OpenGorage("./test.json")
g := Open("./test.json")
userTable := g.FromTable("User")
userTable.Insert([]interface{}{"Thomas", 33, nil})
userTable.Insert([]interface{}{"Carlos", 55, "USA"})
Expand All @@ -175,7 +175,7 @@ g.Save()
return
}
}
gorage := CreateNewGorage("./Social", false, false)
gorage := Create("./Social", false, false)
userTable := gorage.CreateTable("User")
if userTable == nil {
return
Expand Down

0 comments on commit 97d0f2e

Please sign in to comment.