Skip to content

Commit c0410cc

Browse files
committed
Remove "SQL" prefix from types
1 parent d7ecac3 commit c0410cc

11 files changed

+734
-756
lines changed

src/ast/ddl.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! AST types specific to CREATE/ALTER variants of `SQLStatement`
22
//! (commonly referred to as Data Definition Language, or DDL)
3-
use super::{Expr, SQLIdent, SQLObjectName};
3+
use super::{Expr, Ident, ObjectName};
44

55
/// An `ALTER TABLE` (`SQLStatement::SQLAlterTable`) operation
66
#[derive(Debug, Clone, PartialEq, Hash)]
77
pub enum AlterTableOperation {
88
/// `ADD <table_constraint>`
99
AddConstraint(TableConstraint),
1010
/// TODO: implement `DROP CONSTRAINT <name>`
11-
DropConstraint { name: SQLIdent },
11+
DropConstraint { name: Ident },
1212
}
1313

1414
impl ToString for AlterTableOperation {
@@ -26,29 +26,29 @@ impl ToString for AlterTableOperation {
2626
pub enum TableConstraint {
2727
/// `[ CONSTRAINT <name> ] { PRIMARY KEY | UNIQUE } (<columns>)`
2828
Unique {
29-
name: Option<SQLIdent>,
30-
columns: Vec<SQLIdent>,
29+
name: Option<Ident>,
30+
columns: Vec<Ident>,
3131
/// Whether this is a `PRIMARY KEY` or just a `UNIQUE` constraint
3232
is_primary: bool,
3333
},
3434
/// A referential integrity constraint (`[ CONSTRAINT <name> ] FOREIGN KEY (<columns>)
3535
/// REFERENCES <foreign_table> (<referred_columns>)`)
3636
ForeignKey {
37-
name: Option<SQLIdent>,
38-
columns: Vec<SQLIdent>,
39-
foreign_table: SQLObjectName,
40-
referred_columns: Vec<SQLIdent>,
37+
name: Option<Ident>,
38+
columns: Vec<Ident>,
39+
foreign_table: ObjectName,
40+
referred_columns: Vec<Ident>,
4141
},
4242
/// `[ CONSTRAINT <name> ] CHECK (<expr>)`
4343
Check {
44-
name: Option<SQLIdent>,
44+
name: Option<Ident>,
4545
expr: Box<Expr>,
4646
},
4747
}
4848

4949
impl ToString for TableConstraint {
5050
fn to_string(&self) -> String {
51-
fn format_constraint_name(name: &Option<SQLIdent>) -> String {
51+
fn format_constraint_name(name: &Option<Ident>) -> String {
5252
name.as_ref()
5353
.map(|name| format!("CONSTRAINT {} ", name))
5454
.unwrap_or_default()

0 commit comments

Comments
 (0)