Introduce SQLObjectName struct (4.1/4.4)

(To store "A name of a table, view, custom type, etc., possibly
multi-part, i.e. db.schema.obj".)

Before this change

  - some places used `String` for this (these are updated in this commit)

  - while others (notably SQLStatement::SQLDelete::relation, which is
    the reason for this series of commits) relied on
    ASTNode::SQLCompoundIdentifier (which is also backed by a 
    Vec<SQLIdent>, but, as a variant of ASTNode enum, is not convenient
    to use when you know you need that specific variant).
This commit is contained in:
Nickolay Ponomarev 2019-01-30 21:16:31 +03:00
parent 215820ef66
commit 523f086be7
6 changed files with 42 additions and 27 deletions

View file

@ -364,7 +364,7 @@ fn parse_create_table() {
);
match ast {
SQLStatement::SQLCreateTable { name, columns } => {
assert_eq!("uk_cities", name);
assert_eq!("uk_cities", name.to_string());
assert_eq!(3, columns.len());
let c_name = &columns[0];