Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ax4w committed Nov 13, 2023
1 parent abf16dd commit abc7760
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,45 @@ userTable.Insert([]interface{}{"Anna", nil, "USA"})
g.Save()
```

#### Full Example
```go
if fileExists("./Social") {
err := os.Remove("./Social")
if err != nil {
t.Fatalf("Error removing old test file")
return
}
}
gorage := CreateNewGorage("./Social", false, false)
userTable := gorage.CreateTable("User")
if userTable == nil {
return
}
userTable.
AddColumn("Name", STRING).
AddColumn("Handle", STRING).
AddColumn("Age", INT)
gorage.Save()

userTable.Insert([]interface{}{"Emily", "@Emily", 20})
userTable.Insert([]interface{}{"Emily", "@Emily_Backup", 20})
userTable.Insert([]interface{}{"Carl", "@Carl", 23})

gorage.Save()

userTable.
Where(":Handle == '@Emily'").
Update(map[string]interface{}{
"Name": "Emily MLG",
})

gorage.Save()
userTable.Where(":Handle == '@Emily_Backup' || :Name == 'Carl'").Delete()
gorage.Save()


```

## Eval Operations
Eval currently supports && (AND), || (OR), !& (NAND), !| (NOR), == (EQUAL), != (NOT EQUAL), <, <=, >, >= and Braces ( ).

Expand Down

0 comments on commit abc7760

Please sign in to comment.