-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add CREATE DATABASE command to SQL #2094
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
i think i just need to rebase / resolve conflicts |
2aae820
to
21c979b
Compare
Just need to add a test |
Im a little confused why getting a |
91fc5fb
to
279b906
Compare
i think im going to need to add some logic for properly adding a schema to a catalog |
Given there isnt a sql parameter in postgres for specifying the database for a schema (it uses the current active db - https://www.postgresql.org/docs/current/sql-createschema.html) i think we could do one or both of the following:
i personally think the second approach would align well with how catalogs / schemas are set using |
I agree the second approach seems reasonable 👍 |
yeah, make sense |
@alamb I believe this is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks @matthewmturner
@@ -363,6 +374,8 @@ pub enum LogicalPlan { | |||
CreateMemoryTable(CreateMemoryTable), | |||
/// Creates a new catalog schema. | |||
CreateCatalogSchema(CreateCatalogSchema), | |||
/// Creates a new catalog schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Creates a new catalog schema. | |
/// Creates a new catalog (aka "Database"). |
pub schema: DFSchemaRef, | ||
} | ||
|
||
/// Creates a catalog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Creates a catalog. | |
/// Creates a catalog (aka "Database") |
ctx.sql("CREATE DATABASE test").await?.collect().await?; | ||
|
||
// Create schema | ||
ctx.sql("CREATE SCHEMA test.abc").await?.collect().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is cool 👍
Which issue does this PR close?
Second task from #1877
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?