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 Keyword DATABASE synonym SCHEMA #4855

Merged

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Apr 14, 2022

Link to ISSUE #4854

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Support Keyword DATABASE synonym SCHEMA

Changelog

  • New Feature
  • Documentation

Related Issues

Fixes #4854

@vercel
Copy link

vercel bot commented Apr 14, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/databend/databend/44Zg6EHT7MGtS3cyMqfGcxUBRDwQ
✅ Preview: https://databend-git-fork-tceason-issue-4854-supportuse-107f9e-databend.vercel.app

@mergify
Copy link
Contributor

mergify bot commented Apr 14, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added pr-feature this PR introduces a new feature to the codebase pr-build this PR changes build/testing/ci steps pr-doc-fix labels Apr 14, 2022
@@ -7,9 +7,11 @@ Drop a database.
## Syntax

```sql
DROP DATABASE [IF EXISTS] <database_name>
DROP { DATABASE | SCHEMA } [IF EXISTS] <database_name>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we no need to add CREATE SCHEMA syntax, for some databases, schema is not same as database:
https://docs.snowflake.com/en/sql-reference/sql/create-schema.html

SCHEMA keyword is only a compatibility, not a feature, let's keep it clear for the user.

## Syntax

```
SHOW CREATE { DATABASE | SCHEMA } database_name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -13,3 +13,19 @@ CREATE DATABASE system; -- {ErrorCode 2301}
DROP DATABASE system; -- {ErrorCode 1002}

CREATE DATABASE db.t; -- {ErrorCode 1005}

DROP SCHEMA IF EXISTS db;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test about SCHEMA is ok here :D

@BohuTANG BohuTANG merged commit 8e84a2f into databendlabs:main Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-build this PR changes build/testing/ci steps pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Support with keyword SCHEMA as synonym for database
3 participants