Created
February 8, 2022 12:06
-
-
Save asim/8083b741c34e44512e525540618ecc93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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