mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 03:45:59 +00:00
mongo query splitter, copy as mongo insert
This commit is contained in:
@@ -228,7 +228,7 @@ function changeSetInsertToSql(
|
||||
const table = dbinfo.tables.find(x => x.schemaName == item.schemaName && x.pureName == item.pureName);
|
||||
if (table) {
|
||||
const autoIncCol = table.columns.find(x => x.autoIncrement);
|
||||
console.log('autoIncCol', autoIncCol);
|
||||
// console.log('autoIncCol', autoIncCol);
|
||||
if (autoIncCol && fields.find(x => x.targetColumn == autoIncCol.columnName)) {
|
||||
autoInc = true;
|
||||
}
|
||||
@@ -375,7 +375,7 @@ export function getChangeSetInsertedRows(changeSet: ChangeSet, name?: NamedObjec
|
||||
}
|
||||
|
||||
export function changeSetInsertNewRow(changeSet: ChangeSet, name?: NamedObjectInfo): ChangeSet {
|
||||
console.log('INSERT', name);
|
||||
// console.log('INSERT', name);
|
||||
const insertedRows = getChangeSetInsertedRows(changeSet, name);
|
||||
return {
|
||||
...changeSet,
|
||||
|
||||
@@ -89,10 +89,12 @@ export class CollectionGridDisplay extends GridDisplay {
|
||||
setConfig: ChangeConfigFunc,
|
||||
cache: GridCache,
|
||||
setCache: ChangeCacheFunc,
|
||||
loadedRows
|
||||
loadedRows,
|
||||
changeSet
|
||||
) {
|
||||
super(config, setConfig, cache, setCache, driver);
|
||||
this.columns = analyseCollectionDisplayColumns(loadedRows, this);
|
||||
const changedDocs = _.compact([...changeSet.inserts, ...changeSet.updates].map(chs => chs.document));
|
||||
this.columns = analyseCollectionDisplayColumns([...(loadedRows || []), ...changedDocs], this);
|
||||
this.filterable = true;
|
||||
this.sortable = true;
|
||||
this.editable = true;
|
||||
|
||||
Reference in New Issue
Block a user