public MetaDataTable GetViewMetadata(string viewName, string serviceName)
        {
            string schema, name;
            GetSchemaAndName(viewName, serviceName, out schema, out name);

            var metaDataView = new MetaDataTable
            {
                Schema = schema,
                Name = name,
                Columns = GetTableColumns(viewName, serviceName)
            };

            return metaDataView;
        }
        private void AddcolumnsToEntitySymbol(EntitySymbol et, MetaDataTable metadati, out int maxWidth)
        {
            maxWidth = TextRenderer.MeasureText(metadati.Name, new Font(baseEntityFont.FontFamily, baseEntityFont.Size + 3)).Width;
            var names = metadati.Columns.Select(t => t.Name);

            foreach (string name in names)
            {
                et.AddColumn(name);
                maxWidth = TextRenderer.MeasureText(name, baseEntityFont).Width > maxWidth ? TextRenderer.MeasureText(name, baseEntityFont).Width : maxWidth;
            }
        }
        public MetaDataTable GetTableMetadata(string tableName, string serviceName, bool getPK, bool getFKParent, bool getFKChildren, bool getIndexes, bool getSequences)
        {
            string schema, name;
            GetSchemaAndName(tableName, serviceName, out schema, out name);

            var metaDataTable = new MetaDataTable { Schema = schema, Name = name };

            if (getIndexes)
            {
                var indxs = GetTableIndexes(tableName, serviceName);
                metaDataTable.Indexes = indxs;
            }

            if (getFKParent || getFKChildren)
            {
                var fks = GetTableForeignKeys(tableName, serviceName, getFKParent, getFKChildren);
                metaDataTable.ForeignKeys = fks;
            }

            if (getPK)
            {
                var pk = GetTablePrimaryKey(tableName, serviceName);
                metaDataTable.PrimaryKey = pk;
            }

            if (getSequences)
            {
                var seq = GetTableSequence(tableName, serviceName);
                metaDataTable.SequenceName = seq;
            }

            var columns = GetTableColumns(tableName, serviceName);
            metaDataTable.Columns = columns;

            return metaDataTable;
        }