mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-24 19:56:00 +00:00
Merge branch 'develop'
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "5.3.5-beta.3",
|
"version": "5.3.5-beta.6",
|
||||||
"name": "dbgate-all",
|
"name": "dbgate-all",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ function getDisplayColumn(basePath, columnName, display: CollectionGridDisplay)
|
|||||||
filterBehaviour: display?.driver?.getFilterBehaviour(null, standardFilterBehaviours) ?? mongoFilterBehaviour,
|
filterBehaviour: display?.driver?.getFilterBehaviour(null, standardFilterBehaviours) ?? mongoFilterBehaviour,
|
||||||
pureName: display.collection?.pureName,
|
pureName: display.collection?.pureName,
|
||||||
schemaName: display.collection?.schemaName,
|
schemaName: display.collection?.schemaName,
|
||||||
|
|
||||||
|
isPartitionKey: !!display?.collection?.partitionKey?.find(x => x.columnName == uniqueName),
|
||||||
|
isClusterKey: !!display?.collection?.clusterKey?.find(x => x.columnName == uniqueName),
|
||||||
|
isUniqueKey: !!display?.collection?.uniqueKey?.find(x => x.columnName == uniqueName),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ export interface DisplayColumn {
|
|||||||
notNull?: boolean;
|
notNull?: boolean;
|
||||||
autoIncrement?: boolean;
|
autoIncrement?: boolean;
|
||||||
isPrimaryKey?: boolean;
|
isPrimaryKey?: boolean;
|
||||||
|
|
||||||
|
// NoSQL specific
|
||||||
|
isPartitionKey?: boolean;
|
||||||
|
isClusterKey?: boolean;
|
||||||
|
isUniqueKey?: boolean;
|
||||||
|
|
||||||
foreignKey?: ForeignKeyInfo;
|
foreignKey?: ForeignKeyInfo;
|
||||||
isForeignKeyUnique?: boolean;
|
isForeignKeyUnique?: boolean;
|
||||||
isExpandable?: boolean;
|
isExpandable?: boolean;
|
||||||
|
|||||||
@@ -559,7 +559,7 @@
|
|||||||
for (const column of display.columns) {
|
for (const column of display.columns) {
|
||||||
if (column.uniquePath.length > 1) continue;
|
if (column.uniquePath.length > 1) continue;
|
||||||
if (column.autoIncrement) continue;
|
if (column.autoIncrement) continue;
|
||||||
if (column.columnName == '_id' && isDynamicStructure) continue;
|
if (column.isClusterKey) continue;
|
||||||
|
|
||||||
grider.setCellValue(rowIndex, column.uniqueName, grider.getRowData(index)[column.uniqueName]);
|
grider.setCellValue(rowIndex, column.uniqueName, grider.getRowData(index)[column.uniqueName]);
|
||||||
}
|
}
|
||||||
@@ -959,7 +959,9 @@
|
|||||||
|
|
||||||
export async function mergeSelectionIntoMirror({ fullRows, mergeMode = 'merge' }) {
|
export async function mergeSelectionIntoMirror({ fullRows, mergeMode = 'merge' }) {
|
||||||
const file = display.baseTableOrSimilar?.pureName;
|
const file = display.baseTableOrSimilar?.pureName;
|
||||||
const mergeKey = display.baseCollection ? ['_id'] : display.baseTable?.primaryKey.columns.map(x => x.columnName);
|
const mergeKey = display.baseCollection
|
||||||
|
? display.baseCollection?.uniqueKey?.map(x => x.columnName)
|
||||||
|
: display.baseTable?.primaryKey.columns.map(x => x.columnName);
|
||||||
|
|
||||||
const cells = cellsToRegularCells(selectedCells);
|
const cells = cellsToRegularCells(selectedCells);
|
||||||
const rowIndexes = _.sortBy(_.uniq(cells.map(x => x[0])));
|
const rowIndexes = _.sortBy(_.uniq(cells.map(x => x[0])));
|
||||||
|
|||||||
@@ -35,10 +35,14 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
pureName: x.name,
|
pureName: x.name,
|
||||||
tableRowCount: stats[index]?.count,
|
tableRowCount: stats[index]?.count,
|
||||||
uniqueKey: [{ columnName: '_id' }],
|
uniqueKey: [{ columnName: '_id' }],
|
||||||
|
partitionKey: [{ columnName: '_id' }],
|
||||||
|
clusterKey: [{ columnName: '_id' }],
|
||||||
})),
|
})),
|
||||||
...views.map((x, index) => ({
|
...views.map((x, index) => ({
|
||||||
pureName: x.name,
|
pureName: x.name,
|
||||||
uniqueKey: [{ columnName: '_id' }],
|
uniqueKey: [{ columnName: '_id' }],
|
||||||
|
partitionKey: [{ columnName: '_id' }],
|
||||||
|
clusterKey: [{ columnName: '_id' }],
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ const driver = {
|
|||||||
|
|
||||||
getCollectionExportQueryScript(collection, condition, sort) {
|
getCollectionExportQueryScript(collection, condition, sort) {
|
||||||
return `db.collection('${collection}')
|
return `db.collection('${collection}')
|
||||||
.find(${JSON.stringify(convertToMongoCondition(condition) || {})})
|
.find(${JSON.stringify(convertToMongoCondition(condition) || {})})
|
||||||
.sort(${JSON.stringify(convertToMongoSort(sort) || {})})`;
|
.sort(${JSON.stringify(convertToMongoSort(sort) || {})})`;
|
||||||
},
|
},
|
||||||
getCollectionExportQueryJson(collection, condition, sort) {
|
getCollectionExportQueryJson(collection, condition, sort) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user