Skip to content

Instantly share code, notes, and snippets.

@asim
Last active February 8, 2022 12:15
Show Gist options
  • Save asim/8fa125e3c27db7148eb0d94048bd50b2 to your computer and use it in GitHub Desktop.
Save asim/8fa125e3c27db7148eb0d94048bd50b2 to your computer and use it in GitHub Desktop.

Revisions

  1. asim revised this gist Feb 8, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion read.go
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ import (
    func main() {
    dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
    rsp, err := dbService.Read(&db.ReadRequest{
    Query: "age == 43",
    Query: "age == 42",
    Table: "example",
    })
    fmt.Println(rsp, err)
  2. asim created this gist Feb 8, 2022.
    18 changes: 18 additions & 0 deletions read.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    package main

    import (
    "fmt"
    "os"

    "go.m3o.com/db"
    )

    // Read data from a table. Lookup can be by ID or via querying any field in the record.
    func main() {
    dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
    rsp, err := dbService.Read(&db.ReadRequest{
    Query: "age == 43",
    Table: "example",
    })
    fmt.Println(rsp, err)
    }