Example #1
0
        public void Test_GetTableInfoList()
        {
            IDbMaintenance maintenance = new SqlServerDbMaintenance();
            var            result      = maintenance.GetTableInfoList();

            foreach (var info in result)
            {
                Console.WriteLine($"表名:{info.Name},备注:{info.Description}");
            }
        }
Example #2
0
        public void Test_GetColumnInfosByTableName_SqlServer()
        {
            IDbMaintenance maintenance = new SqlServerDbMaintenance();
            var            result      = maintenance.GetTableInfoList();

            foreach (var info in result)
            {
                Console.WriteLine($"表名:{info.Name},备注:{info.Description}");
                var columns = maintenance.GetColumnInfosByTableName(info.Name);
                foreach (var column in columns)
                {
                    Console.WriteLine($"    列名:{column.DbColumnName},数据类型:{column.DataType},长度:{column.Length},默认值:{column.DefaultValue},主键:{column.IsPrimaryKey},可空:{column.IsNullable},备注:{column.ColumnDescription}");
                }
            }
        }