protected DataProvider(string server, string slaveServer, string user, string pass)
        {
            fieldsTable = new FieldTranslationCollection(ParameterPrefix, QuotationChar);
            InitFieldNames();
            InitUpgradeTable();

            Server      = server;
            SlaveServer = slaveServer;
            User        = user;
            Password    = pass;
        }
Example #2
0
        internal SelectBuilder(FieldTranslationCollection fTrans, string query = null)
        {
            if (fTrans == null)
            {
                throw new ArgumentNullException("fTrans");
            }

            this.fTrans = fTrans;
            InitPrefixes();

            selectClause = new SelectColumnInfoCollection(fTrans);
            if (string.IsNullOrEmpty(query))
            {
                fromClause    = string.Empty;
                whereClause   = new List <KeyValuePair <string, ConditionCombineLogic> > ();
                havingClause  = new List <KeyValuePair <string, ConditionCombineLogic> > ();
                groupByClause = new List <string> ();
                orderByClause = new List <string> ();
            }
            else
            {
                LoadQuery(query);
            }
        }
        protected override void InitializeColumnManagers()
        {
            FieldTranslationCollection fTrans = provider.FieldsTable;
            SelectBuilder sBuilder            = new SelectBuilder(fTrans, commandText);

            colManagers = new DbColumnManager [sBuilder.SelectClause.Count];
            foreach (SelectColumnInfo columnInfo in sBuilder.SelectClause)
            {
                columns.Add(fTrans.StripQuotationChars(columnInfo.ColumnName));
            }

            DbField [] fields = fTrans.TranslateToDbField(columns.ToArray());
            for (int i = 0; i < columns.Count; i++)
            {
                LazyTableColumnManager lcm = new LazyTableColumnManager(i, fields [i]);
                string columnName          = columns [i];

                colManagers [i]              = lcm;
                dbPropManagers [columnName]  = lcm;
                allPropManagers [columnName] = lcm;
            }

            translateManagers = false;
        }
 internal SelectColumnInfoCollection(FieldTranslationCollection fCol)
 {
     fieldTrans = fCol;
 }
 internal SQLiteHelper(FieldTranslationCollection fTrans)
     : base(fTrans)
 {
 }