1
0
Fork 0
mirror of synced 2024-07-31 11:01:24 +12:00
appwrite/app/sdks/go/docs/examples/Database/CreateCollection.md

35 lines
684 B
Markdown
Raw Normal View History

2019-10-14 09:19:06 +13:00
# Database Examples
## CreateCollection
```go
package appwrite-createcollection
import (
"fmt"
"os"
"github.com/appwrite/sdk-for-go"
)
func main() {
// Create a Client
var clt := appwrite.Client{}
// Set Client required headers
clt.SetProject("")
clt.SetKey("")
// Create a new Database service passing Client
var srv := appwrite.Database{
client: &clt
}
// Call CreateCollection method and handle results
var res, err := srv.CreateCollection("[NAME]")
if err != nil {
panic(err)
}
fmt.Println(res)
}
```