Skip to content

Commit a649098

Browse files
committed
Update tests
1 parent 1c35f13 commit a649098

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/ast/ddl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2277,10 +2277,10 @@ impl fmt::Display for CreateConnector {
22772277
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22782278
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
22792279
pub struct CreateSnowflakeDatabase {
2280+
pub name: ObjectName,
22802281
pub or_replace: bool,
22812282
pub transient: bool,
22822283
pub if_not_exists: bool,
2283-
pub name: ObjectName,
22842284
pub clone: Option<ObjectName>,
22852285
pub data_retention_time_in_days: Option<u64>,
22862286
pub max_data_extension_time_in_days: Option<u64>,

src/ast/helpers/stmt_create_database.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ use crate::parser::ParserError;
5151
/// )
5252
/// ```
5353
///
54-
/// [1]: crate::ast::Statement::CreateSnowflakeDatabase
5554
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5655
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5756
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
5857
pub struct CreateDatabaseBuilder {
58+
pub name: ObjectName,
5959
pub or_replace: bool,
6060
pub transient: bool,
6161
pub if_not_exists: bool,
62-
pub name: ObjectName,
6362
pub clone: Option<ObjectName>,
6463
pub data_retention_time_in_days: Option<u64>,
6564
pub max_data_extension_time_in_days: Option<u64>,
@@ -79,10 +78,10 @@ pub struct CreateDatabaseBuilder {
7978
impl CreateDatabaseBuilder {
8079
pub fn new(name: ObjectName) -> Self {
8180
Self {
81+
name,
8282
or_replace: false,
8383
transient: false,
8484
if_not_exists: false,
85-
name,
8685
clone: None,
8786
data_retention_time_in_days: None,
8887
max_data_extension_time_in_days: None,
@@ -275,7 +274,6 @@ impl TryFrom<Statement> for CreateDatabaseBuilder {
275274
#[cfg(test)]
276275
mod tests {
277276
use crate::ast::helpers::stmt_create_database::CreateDatabaseBuilder;
278-
use crate::ast::helpers::stmt_create_table::CreateTableBuilder;
279277
use crate::ast::{Ident, ObjectName, Statement};
280278
use crate::parser::ParserError;
281279

tests/sqlparser_common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7714,7 +7714,7 @@ fn parse_exists_subquery() {
77147714
#[test]
77157715
fn parse_create_database() {
77167716
let sql = "CREATE DATABASE mydb";
7717-
match verified_stmt(sql) {
7717+
match all_dialects_except(|d| d.is::<SnowflakeDialect>()).verified_stmt(sql) {
77187718
Statement::CreateDatabase {
77197719
db_name,
77207720
if_not_exists,
@@ -7733,7 +7733,7 @@ fn parse_create_database() {
77337733
#[test]
77347734
fn parse_create_database_ine() {
77357735
let sql = "CREATE DATABASE IF NOT EXISTS mydb";
7736-
match verified_stmt(sql) {
7736+
match all_dialects_except(|d| d.is::<SnowflakeDialect>()).verified_stmt(sql) {
77377737
Statement::CreateDatabase {
77387738
db_name,
77397739
if_not_exists,

0 commit comments

Comments
 (0)