mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
752 B
752 B
import (
"fmt"
"github.com/appwrite/sdk-for-go/client"
"github.com/appwrite/sdk-for-go/tablesdb"
)
client := client.New(
client.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1")
client.WithProject("<YOUR_PROJECT_ID>")
client.WithSession("")
)
service := tablesdb.New(client)
response, error := service.CreateRow(
"<DATABASE_ID>",
"<TABLE_ID>",
"<ROW_ID>",
map[string]interface{}{
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": false
},
tablesdb.WithCreateRowPermissions(interface{}{"read("any")"}),
tablesdb.WithCreateRowTransactionId("<TRANSACTION_ID>"),
)