예제 #1
0
        /// <summary>
        /// adds an Table for using in a Join
        /// </summary>
        /// <param name="mstruct"></param>
        /// <param name="mstructRight"></param>
        public void addJoinTable(MysqlStruct mstruct, MysqlStruct mstructRight)
        {
            JoinTable addleftJoins = new JoinTable(mstruct.tableName, mstructRight.tableName);

            addleftJoins.addEqualJoinOn(mstruct.name, mstruct.name);
            leftJoins.Add(addleftJoins);
        }
예제 #2
0
        public string getDiffAlter(MysqlStruct compareStruct)
        {
            string info = "";

            if (this.type != null && this.type != compareStruct.type)
            {
                info += "";
            }

            return(info);
        }
예제 #3
0
        public static void getMaskedSql(string sql, MysqlStruct currentStruct)
        {
            ArrayList items    = new ArrayList();
            String    filename = "mysqldef.dat";

            if (File.Exists(filename))
            {
                string       lineval    = "";
                StreamReader filereader = new StreamReader(filename);
                while ((lineval = filereader.ReadLine()) != null)
                {
                    items.Add(lineval);
                }
                filereader.Close();
                //items.Sort();
            }
        }
예제 #4
0
        public void getTableStruct(string tableName)
        {
            if (structList == null || structList.Count < 1)
            {
                structList = new List <MysqlStruct>();
            }

            string sql = "SHOW COLUMNS FROM " + tableName;

            if (!this.connected)
            {
                this.connect();
            }

            if (this.connected)
            {
                MySql.Data.MySqlClient.MySqlDataReader res = sql_select(sql);
                if (res != null)
                {
                    while (res.Read())
                    {
                        MysqlStruct result = new MysqlStruct();
                        result.tableName = tableName;
                        result.name      = getReaderAsString("Field", res);
                        result.type      = getReaderAsString("Type", res);
                        result.Null      = getReaderAsString("Null", res);
                        result.Key       = getReaderAsString("Key", res);
                        result.Default   = getReaderAsString("Default", res);
                        result.Extra     = getReaderAsString("Extra", res);
                        result.parseType();
                        if (!structInfoExists(tableName, result.name))
                        {
                            structList.Add(result);
                        }
                    }

                    res.Close();
                }
            }
        }
예제 #5
0
 public bool isEqualTo(MysqlStruct compareStruct)
 {
     return(compareStruct.getStructInfo() == this.getStructInfo());
 }