コード例 #1
0
ファイル: QueryComposer.cs プロジェクト: swaros/projector
        /// <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
ファイル: MysqlStruct.cs プロジェクト: swaros/projector
        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
ファイル: MysqlStruct.cs プロジェクト: swaros/projector
 public bool isEqualTo(MysqlStruct compareStruct)
 {
     return(compareStruct.getStructInfo() == this.getStructInfo());
 }