Esempio n. 1
0
        internal MergeException(Database db, string conflictsTableName)
            : base("Merge failed.")
        {
            if (conflictsTableName != null)
            {
                IList <string> conflictTableList = new List <string>();
                IList <int>    conflictCountList = new List <int>();

                using (View view = db.OpenView("SELECT `Table`, `NumRowMergeConflicts` FROM `" + conflictsTableName + "`"))
                {
                    view.Execute();

                    foreach (Record rec in view)
                    {
                        using (rec)
                        {
                            conflictTableList.Add(rec.GetString(1));
                            conflictCountList.Add((int)rec.GetInteger(2));
                        }
                    }
                }

                this.conflictTables = conflictTableList;
                this.conflictCounts = conflictCountList;
            }
        }
Esempio n. 2
0
        internal TableInfo(Database db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            this.name = name;

            using (View columnsView = db.OpenView("SELECT * FROM `{0}`", name))
            {
                this.columns = new ColumnCollection(columnsView);
            }

            this.primaryKeys = new ReadOnlyCollection <string>(
                TableInfo.GetTablePrimaryKeys(db, name));
        }
Esempio n. 3
0
        internal MergeException(Database db, string conflictsTableName)
            : base("Merge failed.")
        {
            if (conflictsTableName != null)
            {
                IList<string> conflictTableList = new List<string>();
                IList<int> conflictCountList = new List<int>();

                using (View view = db.OpenView("SELECT `Table`, `NumRowMergeConflicts` FROM `" + conflictsTableName + "`"))
                {
                    view.Execute();

                    foreach (Record rec in view) using (rec)
                    {
                        conflictTableList.Add(rec.GetString(1));
                        conflictCountList.Add((int) rec.GetInteger(2));
                    }
                }

                this.conflictTables = conflictTableList;
                this.conflictCounts = conflictCountList;
            }
        }
Esempio n. 4
0
        internal TableInfo(Database db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            this.name = name;

            using (View columnsView = db.OpenView("SELECT * FROM `{0}`", name))
            {
                this.columns = new ColumnCollection(columnsView);
            }

            this.primaryKeys = new ReadOnlyCollection<string>(
                TableInfo.GetTablePrimaryKeys(db, name));
        }