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.
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 == 42",
Table: "example",
})
fmt.Println(rsp, err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment