public virtual void FillTable(ITableStructure table, IDataQueue queue, TableCopyOptions opts) { var colnames = from c in queue.GetRowFormat.Columns select c.ColumnName; bool autoinc = queue.GetRowFormat.FindAutoIncrementColumn() != null; if (autoinc) { m_dmp.AllowIdentityInsert(table.FullName, true); } try { while (!queue.IsEof) { IBedRecord row = queue.GetRecord(); m_dmp.PutCmd("^insert ^into %f (%,i) ^values (%,v)", table, colnames, row); } } finally { queue.CloseReading(); } if (autoinc) { m_dmp.AllowIdentityInsert(table.FullName, false); } }
public BulkCopyJobCommand(ITabularDataStore source, ITabularDataStore target, IRowTransform rowTransform, TableCopyOptions copyOpts) { m_source = source; m_target = target; m_transform = rowTransform; m_copyOptions = copyOpts; }
public override void LoadFromXml(XmlElement xml) { base.LoadFromXml(xml); m_source = (ITabularDataStore)TabularDataStoreAddonType.Instance.LoadAddon(xml.FindElement("Source")); m_target = (ITabularDataStore)TabularDataStoreAddonType.Instance.LoadAddon(xml.FindElement("Target")); m_transformXml = xml.FindElement("Transform"); m_copyOptions = new TableCopyOptions(); m_copyOptions.LoadFromXml(xml.FindElement("CopyOptions")); }
public TableCopyOptions GetOptions() { TableCopyOptions res = new TableCopyOptions(); res.AllowBulkCopy = chbAllowBulkCopy.Checked; res.TruncateBeforeCopy = chbTruncateBeforeCopy.Checked; res.DisableConstraints = chbDisableConstraints.Checked; return(res); }
public override void FillTable(ITableStructure table, IDataQueue queue, TableCopyOptions opts) { var tdst = m_db.GetTable(table.FullName); ITabularDataStore dstds = tdst.GetDataStoreAndReuse(); dstds.CopyOptions = opts; dstds.ProgressInfo = ProgressInfo; IAsyncResult async = dstds.BeginWrite(null, queue); dstds.EndWrite(async); }
public override void FillTable(ITableStructure table, IDataQueue queue, TableCopyOptions opts) { var name = new NameWithSchema(table.FullName.Schema, table.FullName.Name, false); var entry = m_zip.PutNextEntry(XmlTool.NormalizeIdentifier(name.ToString()) + ".drs"); BedDataStats stats = new BedDataStats(); BedTool.WriteQueueToStream(queue, m_zip, stats); ProgressInfo.LogMessage("s_export", LogLevel.Info, Texts.Get("s_exported$table$rows$bytes", "rows", stats.Rows, "bytes", stats.Bytes, "table", table.FullName)); //ZipEntry entry = new ZipEntry(XmlTool.NormalizeIdentifier(table.FullName.ToString()) + ".xml"); //m_zip.PutNextEntry(entry); //XmlTool.WriteQueueToXml(queue, m_zip, "DataSet", "DataRow"); }
public void LoadFromXml(XmlElement xml) { CopyMembers = new DatabaseStructureMembers(); CopyMembers.LoadFromXml_ForJob(xml.FindElement("Members")); TableOptions = new TableCopyOptions(); TableOptions.LoadFromXml(xml.FindElement("TableOptions")); foreach (XmlElement tbl in xml.SelectNodes("DataCopyTables/Table")) { DataCopyTables.Add(NameWithSchema.LoadFromXml(tbl)); } this.LoadPropertiesCore(xml); }
public static string Run(ITableSource src, IDatabaseSource dst, out bool copydata, out TableCopyOptions opts) { CopyTableForm win = new CopyTableForm(src, dst); DialogResult res = win.ShowDialogEx(); copydata = win.cbcopydata.Checked; opts = win.GetCopyOptions(); if (res == DialogResult.OK) { return(win.tbltblname.Text); } return(null); }
public override void FillTable(ITableStructure table, IDataQueue queue, TableCopyOptions opts) { m_dw.FillTable(table, queue, opts); }
public BulkInserterBase() { BatchSize = 100; CopyOptions = new TableCopyOptions(); }
public virtual void FillTable(ITableStructure table, IDataQueue queue, TableCopyOptions opts) { }
public static Job Create(ITabularDataStore source, ITabularDataStore target, IRowTransform rowTransform, TableCopyOptions copyOpts, JobProperties jobProps) { return(Job.FromCommand(new BulkCopyJobCommand(source, target, rowTransform, copyOpts), jobProps)); }