Ejemplo n.º 1
0
        public static MySQLTable GetTable(MySQL sql, string table)
        {
            MySQLTable t = new MySQLTable();

            t.Name = table;

            foreach (DataRow row in sql.RetrieveDataTable($"SHOW COLUMNS FROM {table}").Rows)
            {
                t.Columns.Add(new ColumnProperty(MySQLHelper.Instance, (string)row["Field"], (string)row["Type"]));
            }
            return(t);
        }
Ejemplo n.º 2
0
 public static List <string> GetTables(MySQL sql)
 {
     return(sql.RetrieveDataTable($"select * from information_schema.tables where TABLE_SCHEMA = '{sql.Database}'").Select().Select(x => (string)x["TABLE_NAME"]).ToList());
 }