コード例 #1
0
ファイル: MysqlExplain.cs プロジェクト: swaros/projector
 public MysqlExplain(QueryComposer comp, MysqlHandler connection)
 {
     this.composer = comp;
     this.db       = connection;
     this.explainSelect();
     this.analyse();
 }
コード例 #2
0
ファイル: WhereCompareStats.cs プロジェクト: swaros/projector
        public static String getCompareString(QueryComposer qc, string fieldName)
        {
            string Statement = "";

            string compare = qc.getCompareValue(fieldName);

            if (null != compare)
            {
                switch (compare.ToUpper())
                {
                case "LIKE":
                    Statement = fieldName + " " + compare + " '%" + qc.getWhereValue(fieldName).ToString().Replace("'", @"\'") + "%' ";
                    break;

                case "IN":
                    Statement = fieldName + " " + compare + " (" + qc.getWhereValue(fieldName).ToString().Replace("'", @"\'") + ") ";
                    break;

                case "SUBSELECT":
                    Statement = fieldName + " IN (" + qc.getWhereValue(fieldName) + ") ";
                    break;

                default:
                    Statement = fieldName + " " + compare + " '" + qc.getWhereValue(fieldName).ToString().Replace("'", @"\'") + "' ";
                    break;
                }
            }
            return(Statement);
        }
コード例 #3
0
ファイル: MysqlExplain.cs プロジェクト: swaros/projector
 public MysqlExplain(String sqlStr, MysqlHandler connection)
 {
     this.composer = null;
     this.sql      = sqlStr;
     this.db       = connection;
     this.explainSelect();
     this.analyse();
 }
コード例 #4
0
ファイル: TableToForm.cs プロジェクト: swaros/projector
        public TableToForm(string tableName, MysqlHandler DataBase)
        {
            this.db        = DataBase;
            this.TableName = tableName;
            if (!DataBase.isConnected())
            {
                throw new Exception("Database not connected. TableToForm needs an connected MysqlHandler");
            }

            maskQuery = new QueryComposer(this.TableName);
        }