Skip to content

Commit 2fbd2df

Browse files
committed
feat: Show View
1 parent c71a00c commit 2fbd2df

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/binder/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ pub mod expr;
1515
mod insert;
1616
mod select;
1717
mod show_table;
18+
mod show_view;
1819
mod truncate;
1920
mod update;
20-
mod show_view;
2121

2222
use sqlparser::ast::{Ident, ObjectName, ObjectType, SetExpr, Statement};
2323
use std::collections::{BTreeMap, HashMap, HashSet};
@@ -415,9 +415,9 @@ impl<'a, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'a, '
415415
let value = variable[0].value.clone();
416416
match &value[..] {
417417
"views" => self.bind_show_views()?,
418-
_ => return Err(DatabaseError::UnsupportedStmt(stmt.to_string()))
418+
_ => return Err(DatabaseError::UnsupportedStmt(stmt.to_string())),
419419
}
420-
},
420+
}
421421
Statement::Copy {
422422
source,
423423
to,

src/execution/dql/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ pub(crate) mod limit;
1010
pub(crate) mod projection;
1111
pub(crate) mod seq_scan;
1212
pub(crate) mod show_table;
13+
pub(crate) mod show_view;
1314
pub(crate) mod sort;
1415
pub(crate) mod union;
1516
pub(crate) mod values;
16-
pub(crate) mod show_view;
1717

1818
#[cfg(test)]
1919
pub(crate) mod test {

src/execution/dql/show_view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
use crate::catalog::view::View;
12
use crate::catalog::TableMeta;
23
use crate::execution::{Executor, ReadExecutor};
34
use crate::storage::{StatisticsMetaCache, TableCache, Transaction, ViewCache};
45
use crate::throw;
56
use crate::types::tuple::Tuple;
67
use crate::types::value::{DataValue, Utf8Type};
78
use sqlparser::ast::CharLengthUnits;
8-
use crate::catalog::view::View;
99

1010
pub struct ShowViews;
1111

1212
impl<'a, T: Transaction + 'a> ReadExecutor<'a, T> for ShowViews {
1313
fn execute(
1414
self,
15-
(TableCache,_,_): (&'a TableCache, &'a ViewCache, &'a StatisticsMetaCache),
15+
(TableCache, _, _): (&'a TableCache, &'a ViewCache, &'a StatisticsMetaCache),
1616
transaction: *mut T,
1717
) -> Executor<'a> {
1818
Box::new(

src/execution/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use crate::execution::dql::limit::Limit;
3232
use crate::execution::dql::projection::Projection;
3333
use crate::execution::dql::seq_scan::SeqScan;
3434
use crate::execution::dql::show_table::ShowTables;
35+
use crate::execution::dql::show_view::ShowViews;
3536
use crate::execution::dql::sort::Sort;
3637
use crate::execution::dql::union::Union;
3738
use crate::execution::dql::values::Values;
@@ -42,7 +43,6 @@ use crate::storage::{StatisticsMetaCache, TableCache, Transaction, ViewCache};
4243
use crate::types::index::IndexInfo;
4344
use crate::types::tuple::Tuple;
4445
use std::ops::Coroutine;
45-
use crate::execution::dql::show_view::ShowViews;
4646

4747
pub type Executor<'a> =
4848
Box<dyn Coroutine<Yield = Result<Tuple, DatabaseError>, Return = ()> + 'a + Unpin>;

src/storage/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ use crate::types::value::DataValue;
1616
use crate::types::{ColumnId, LogicalType};
1717
use crate::utils::lru::SharedLruCache;
1818
use itertools::Itertools;
19+
use sqlparser::keywords::NULL;
1920
use std::collections::Bound;
2021
use std::io::Cursor;
2122
use std::mem;
2223
use std::ops::SubAssign;
2324
use std::sync::Arc;
2425
use std::vec::IntoIter;
25-
use sqlparser::keywords::NULL;
2626
use ulid::Generator;
2727

2828
pub(crate) type StatisticsMetaCache = SharedLruCache<(TableName, IndexId), StatisticsMeta>;

0 commit comments

Comments
 (0)