-
Notifications
You must be signed in to change notification settings - Fork 622
Snowflake create database #1939
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
base: main
Are you sure you want to change the base?
Snowflake create database #1939
Conversation
src/ast/mod.rs
Outdated
/// CREATE [ OR REPLACE ] [ TRANSIENT ] DATABASE [ IF NOT EXISTS ] <name> | ||
/// [ CLONE <source_schema> | ||
/// [ { AT | BEFORE } ( { TIMESTAMP => <timestamp> | OFFSET => <time_difference> | STATEMENT => <id> } ) ] | ||
/// [ IGNORE TABLES WITH INSUFFICIENT DATA RETENTION ] | ||
/// [ IGNORE HYBRID TABLES ] ] | ||
/// [ DATA_RETENTION_TIME_IN_DAYS = <integer> ] | ||
/// [ MAX_DATA_EXTENSION_TIME_IN_DAYS = <integer> ] | ||
/// [ EXTERNAL_VOLUME = <external_volume_name> ] | ||
/// [ CATALOG = <catalog_integration_name> ] | ||
/// [ REPLACE_INVALID_CHARACTERS = { TRUE | FALSE } ] | ||
/// [ DEFAULT_DDL_COLLATION = '<collation_specification>' ] | ||
/// [ STORAGE_SERIALIZATION_POLICY = { COMPATIBLE | OPTIMIZED } ] | ||
/// [ COMMENT = '<string_literal>' ] | ||
/// [ CATALOG_SYNC = '<snowflake_open_catalog_integration_name>' ] | ||
/// [ CATALOG_SYNC_NAMESPACE_MODE = { NEST | FLATTEN } ] | ||
/// [ CATALOG_SYNC_NAMESPACE_FLATTEN_DELIMITER = '<string_literal>' ] | ||
/// [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ] | ||
/// [ WITH CONTACT ( <purpose> = <contact_name> [ , <purpose> = <contact_name> ... ] ) ] |
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.
Re documentation, i think using a simple example or only mentioning that it represents the CREATE DATABASE
statement would suffice, the actual spec we can delegate to the linked documentation for each dialect.
impl ContactEntry { | ||
pub fn new(purpose: String, contact: String) -> Self { | ||
Self { purpose, contact } | ||
} | ||
} |
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.
impl ContactEntry { | |
pub fn new(purpose: String, contact: String) -> Self { | |
Self { purpose, contact } | |
} | |
} |
I think we can remove this in order to keep the public API surface smaller
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.
What should we use instead?
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.
it has specific display format write!(f, "{} = {}", self.purpose, self.contact)
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.
Ah sorry to clarify I meant that we should remove the new
function, not the struct itself. So that callers can manually do ContactEntry { purpose, "foo", contact: "bar" }
instead of ContactEntry::new("foo", "bar")
https://docs.snowflake.com/en/sql-reference/sql/create-database
Added support for
Closes #1938