Example #1
0
        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);
        }
Example #2
0
        public override object VisitShowTablesStatement([NotNull] MiniSQLParser.ShowTablesStatementContext context)
        {
            ShowStatement statement = new ShowStatement();

            statement.ShowType = ShowType.Table;
            return(statement);
        }
Example #3
0
        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);
        }