pub struct CreateView {
pub name: QualifiedName,
pub sql: String,
pub statement: String,
pub aliases: Vec<String>,
pub if_not_exists: bool,
pub or_replace: bool,
pub columns: Vec<Field>,
}Expand description
A bound CREATE VIEW.
The body is the text that was written rather than the plan it bound to. It was bound once on the
way through here, which is what refuses a view over a table that is not there, and the plan that
came out of that is then thrown away, because a view follows the tables underneath it and a plan
cannot. See rudb_catalog::View.
Fields§
§name: QualifiedNameThe full name the view gets.
sql: StringThe body, as written.
statement: StringThe whole statement written back out, which is what duckdb_views() reports as sql.
Written here because this is the last place the tree is in reach. See
rudb_catalog::View::statement for what the column is and why it is not the text.
aliases: Vec<String>The column names the statement gave, which rename a prefix of what the body produces.
if_not_exists: boolWhether an existing entry of that name is left alone rather than being an error.
or_replace: boolWhether an existing entry of that name is dropped first.
columns: Vec<Field>The columns binding the body produced, after the alias list was applied.
Worked out here because this is where the body is bound, and carried to the catalog because
that is where duckdb_columns() and duckdb_views() read it from. See the doc on
rudb_catalog::View for why the catalog keeps a list it will have to refresh later.