🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
< Docs
  • Go

CreateDatabase()

This method creates a database.

func (c *Client) CreateDatabase(ctx context.Context, option CreateDatabaseOption, callOptions ...grpc.CallOption) error

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

CreateDatabaseOption

callOpts

Optional parameters for calling the methods.

grpc.CallOption

CreateDatabaseOption

This is an interface type. The createDatabaseOption struct type implements this interface type.

You can use the NewCreateDatabaseOption() function to get the concrete implementation.

NewCreateDatabaseOption

The signature of this method is as follows:

func NewCreateDatabaseOption(dbName string) *createDatabaseOption

Parameter

Description

Type

dbName

Name of the database to create.

string

Return

Null

Example

dbName := `test_db`
cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{
    Address: milvusAddr,
})
if err != nil {
    // handle err
}

err = cli.CreateDatabase(ctx, milvusclient.NewCreateDatabaseOption(dbName))
if err != nil {
    // handle err
}

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?