private SelectResult HandleSelectStatement(ShowStatement statement) { List <SchemaRecord> tableSchemas = _catalogManager.GetTablesSchemaRecord(); SelectResult result = new SelectResult(); result.ColumnDeclarations = new List <AttributeDeclaration>() { new AttributeDeclaration() { AttributeName = "Table", Type = AttributeTypes.Char, CharLimit = 80 } }; result.Rows = new List <List <AtomValue> >(); foreach (SchemaRecord tableSchema in tableSchemas) { List <AtomValue> row = new List <AtomValue>(); AtomValue col = new AtomValue(); col.Type = AttributeTypes.Char; col.CharLimit = 80; col.StringValue = tableSchema.Name; row.Add(col); result.Rows.Add(row); } return(result); }
public override object VisitShowTablesStatement([NotNull] MiniSQLParser.ShowTablesStatementContext context) { ShowStatement statement = new ShowStatement(); statement.ShowType = ShowType.Table; return(statement); }
protected override void BuildStatement(SqlCodeObjectBuilder builder) { var target = ParseTarget(Target); var statement = new ShowStatement(target); if (!String.IsNullOrEmpty(TableName)) { statement.TableName = ObjectName.Parse(TableName); } builder.AddObject(statement); }