Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support create/drop database #597

Closed
jiacai2050 opened this issue Jan 31, 2023 · 2 comments
Closed

Support create/drop database #597

jiacai2050 opened this issue Jan 31, 2023 · 2 comments
Labels
feature New feature or request

Comments

@jiacai2050
Copy link
Contributor

jiacai2050 commented Jan 31, 2023

Describe This Problem

In current implementation, there is only one database(called schema in src), we should support database creation to allow one server holding multiple databases.

Proposal

Support those SQL

create database NAME;
drop database NAME;

As for distributed deployment, ceresmeta need to distribute newly-created database to all servers.

Additional Context

For distributed mode, the default database is created when server start up, it should first communicate with ceresmeta to check whether this database is already existing.

apache/incubator-horaedb-meta#136

@jackbit
Copy link

jackbit commented Nov 24, 2023

Hi, is it done? any documentation for it? how to implement it?

//->#go-sdk

client, err := ceresdb.NewClient(endpoint, ceresdb.Direct)

if err != nil {
  return err
}

resp, err := client.SQLQuery(context.Background(), ceresdb.SQLQueryRequest{
  Tables: []string{},
  SQL:    "create database NAME;",
})

is it correct? i got this error with those script:

err: add request ctx: no database selected, you can use database in client initial options or WriteRequest/SqlQueryRequest

@jiacai2050
Copy link
Contributor Author

Hi, this feature hasn't got implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants