Example #1
0
 public void Run()
 {
     accessorFrom = new SqliteAccessor {
         DataSource = DataSourceFrom, Password = PasswordFrom
     };
     accessorFrom.Open();
     accessorTo = new SqliteAccessor {
         DataSource = DataSourceTo, Password = PasswordTo
     };
     accessorTo.Open();
     FetchTables();
     tables.ForEach(t => {
         CreateTable(t.Sql);
         if (t.HasBlob)
         {
             TransferBlob(t);
         }
         else
         {
             TransferNoBlob(t);
         }
     });
     accessorFrom.Close();
     accessorTo.Close();
 }
Example #2
0
        private void PerformQueryWholeTable(string tableName)
        {
            if (string.IsNullOrEmpty(tableName))
            {
                return;
            }
            var tableInfo = new Schema().QueryTableInfo(tableName);

            if (0 == tableInfo.Count)
            {
                return;
            }
            var query = @" SELECT " + '\n';

            query += tableInfo
                     .Select((row, index) => new { index, columnName = row[1] })
                     .Aggregate(@"",
                                (ret, item) =>
                                0 == item.index
                            ? ret + @"     " + item.columnName + @" " + '\n'
                            : ret + @"   , " + item.columnName + @" " + '\n');

            query += @" FROM " + '\n';
            query += @"     " + tableName + @" " + '\n';
            var accessor = new SqliteAccessor {
                DataSource  = AppBehind.Get.DBFilePath,
                Password    = AppBehind.Get.Password,
                QueryString = query
            };

            accessor.Open();
            accessor.Execute(accessor.CreateCommand());
            accessor.Close();
            AppBehind.Get.SetQueryString(query);
            AppBehind.Get.AddPage(accessor);
        }
Example #3
0
 public void Close()
 {
     accessor.Close();
 }