Skip to content

Instantly share code, notes, and snippets.

@asim
Created February 8, 2022 12:06
Show Gist options
  • Save asim/8083b741c34e44512e525540618ecc93 to your computer and use it in GitHub Desktop.
Save asim/8083b741c34e44512e525540618ecc93 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"go.m3o.com/db"
)
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
func main() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Create(&db.CreateRequest{
Record: map[string]interface{}{
"id": "1",
"name": "Jane",
"age": 42,
"isActive": true,
},
Table: "example",
})
fmt.Println(rsp, err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment