dbgate-datalib 7.1.13 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ChangeSet.d.ts +14 -13
- package/lib/ChangeSet.js +19 -2
- package/lib/EditableQueryResultDisplay.d.ts +37 -0
- package/lib/EditableQueryResultDisplay.js +144 -0
- package/lib/FreeTableGridDisplay.d.ts +2 -0
- package/lib/GridDisplay.d.ts +8 -0
- package/lib/GridDisplay.js +10 -0
- package/lib/JslGridDisplay.d.ts +9 -2
- package/lib/JslGridDisplay.js +57 -13
- package/lib/QueryResultChangeSet.d.ts +5 -0
- package/lib/QueryResultChangeSet.js +33 -0
- package/lib/TableGridDisplay.d.ts +1 -0
- package/lib/ViewGridDisplay.d.ts +23 -4
- package/lib/ViewGridDisplay.js +46 -8
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/package.json +5 -5
package/lib/ChangeSet.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Condition } from 'dbgate-sqltree';
|
|
2
2
|
import type { NamedObjectInfo, DatabaseInfo, TableInfo, SqlDialect } from 'dbgate-types';
|
|
3
3
|
import { JsonDataObjectUpdateCommand } from 'dbgate-tools';
|
|
4
|
+
export type ChangeSetValue = any;
|
|
4
5
|
export interface ChangeSetItem {
|
|
5
6
|
pureName: string;
|
|
6
7
|
schemaName?: string;
|
|
@@ -8,13 +9,13 @@ export interface ChangeSetItem {
|
|
|
8
9
|
existingRowIndex?: number;
|
|
9
10
|
document?: any;
|
|
10
11
|
condition?: {
|
|
11
|
-
[column: string]:
|
|
12
|
+
[column: string]: ChangeSetValue;
|
|
12
13
|
};
|
|
13
14
|
fields?: {
|
|
14
|
-
[column: string]:
|
|
15
|
+
[column: string]: ChangeSetValue;
|
|
15
16
|
};
|
|
16
17
|
insertIfNotExistsFields?: {
|
|
17
|
-
[column: string]:
|
|
18
|
+
[column: string]: ChangeSetValue;
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
export interface ChangeSetItemFields {
|
|
@@ -34,7 +35,7 @@ export interface ChangeSetRowDefinition {
|
|
|
34
35
|
insertedRowIndex?: number;
|
|
35
36
|
existingRowIndex?: number;
|
|
36
37
|
condition?: {
|
|
37
|
-
[column: string]:
|
|
38
|
+
[column: string]: ChangeSetValue;
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
export interface ChangeSetFieldDefinition extends ChangeSetRowDefinition {
|
|
@@ -63,13 +64,13 @@ export declare function removeSchemaFromChangeSet(changeSet: ChangeSet): {
|
|
|
63
64
|
existingRowIndex?: number;
|
|
64
65
|
document?: any;
|
|
65
66
|
condition?: {
|
|
66
|
-
[column: string]:
|
|
67
|
+
[column: string]: any;
|
|
67
68
|
};
|
|
68
69
|
fields?: {
|
|
69
|
-
[column: string]:
|
|
70
|
+
[column: string]: any;
|
|
70
71
|
};
|
|
71
72
|
insertIfNotExistsFields?: {
|
|
72
|
-
[column: string]:
|
|
73
|
+
[column: string]: any;
|
|
73
74
|
};
|
|
74
75
|
}[];
|
|
75
76
|
updates: {
|
|
@@ -79,13 +80,13 @@ export declare function removeSchemaFromChangeSet(changeSet: ChangeSet): {
|
|
|
79
80
|
existingRowIndex?: number;
|
|
80
81
|
document?: any;
|
|
81
82
|
condition?: {
|
|
82
|
-
[column: string]:
|
|
83
|
+
[column: string]: any;
|
|
83
84
|
};
|
|
84
85
|
fields?: {
|
|
85
|
-
[column: string]:
|
|
86
|
+
[column: string]: any;
|
|
86
87
|
};
|
|
87
88
|
insertIfNotExistsFields?: {
|
|
88
|
-
[column: string]:
|
|
89
|
+
[column: string]: any;
|
|
89
90
|
};
|
|
90
91
|
}[];
|
|
91
92
|
deletes: {
|
|
@@ -95,13 +96,13 @@ export declare function removeSchemaFromChangeSet(changeSet: ChangeSet): {
|
|
|
95
96
|
existingRowIndex?: number;
|
|
96
97
|
document?: any;
|
|
97
98
|
condition?: {
|
|
98
|
-
[column: string]:
|
|
99
|
+
[column: string]: any;
|
|
99
100
|
};
|
|
100
101
|
fields?: {
|
|
101
|
-
[column: string]:
|
|
102
|
+
[column: string]: any;
|
|
102
103
|
};
|
|
103
104
|
insertIfNotExistsFields?: {
|
|
104
|
-
[column: string]:
|
|
105
|
+
[column: string]: any;
|
|
105
106
|
};
|
|
106
107
|
}[];
|
|
107
108
|
structure?: TableInfo;
|
package/lib/ChangeSet.js
CHANGED
|
@@ -13,6 +13,23 @@ function createChangeSet() {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
exports.createChangeSet = createChangeSet;
|
|
16
|
+
function normalizeChangeSetValueForCompare(value) {
|
|
17
|
+
if ((value === null || value === void 0 ? void 0 : value.$bigint) != null)
|
|
18
|
+
return value.$bigint;
|
|
19
|
+
if ((value === null || value === void 0 ? void 0 : value.$decimal) != null)
|
|
20
|
+
return value.$decimal;
|
|
21
|
+
if (lodash_1.default.isNumber(value) || lodash_1.default.isBoolean(value))
|
|
22
|
+
return value.toString();
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
function normalizeChangeSetConditionForCompare(condition) {
|
|
26
|
+
if (condition == null)
|
|
27
|
+
return condition;
|
|
28
|
+
return lodash_1.default.mapValues(condition, normalizeChangeSetValueForCompare);
|
|
29
|
+
}
|
|
30
|
+
function isSameChangeSetCondition(left, right) {
|
|
31
|
+
return lodash_1.default.isEqual(normalizeChangeSetConditionForCompare(left), normalizeChangeSetConditionForCompare(right));
|
|
32
|
+
}
|
|
16
33
|
function findExistingChangeSetItem(changeSet, definition) {
|
|
17
34
|
if (!changeSet || !definition)
|
|
18
35
|
return ['updates', null];
|
|
@@ -28,13 +45,13 @@ function findExistingChangeSetItem(changeSet, definition) {
|
|
|
28
45
|
const inUpdates = changeSet.updates.find(x => x.pureName == definition.pureName &&
|
|
29
46
|
x.schemaName == definition.schemaName &&
|
|
30
47
|
((definition.existingRowIndex != null && x.existingRowIndex == definition.existingRowIndex) ||
|
|
31
|
-
(definition.existingRowIndex == null &&
|
|
48
|
+
(definition.existingRowIndex == null && isSameChangeSetCondition(x.condition, definition.condition))));
|
|
32
49
|
if (inUpdates)
|
|
33
50
|
return ['updates', inUpdates];
|
|
34
51
|
const inDeletes = changeSet.deletes.find(x => x.pureName == definition.pureName &&
|
|
35
52
|
x.schemaName == definition.schemaName &&
|
|
36
53
|
((definition.existingRowIndex != null && x.existingRowIndex == definition.existingRowIndex) ||
|
|
37
|
-
(definition.existingRowIndex == null &&
|
|
54
|
+
(definition.existingRowIndex == null && isSameChangeSetCondition(x.condition, definition.condition))));
|
|
38
55
|
if (inDeletes)
|
|
39
56
|
return ['deletes', inDeletes];
|
|
40
57
|
return ['updates', null];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChangeSetFieldDefinition, ChangeSetRowDefinition } from './ChangeSet';
|
|
2
|
+
import { DisplayColumn } from './GridDisplay';
|
|
3
|
+
import { DatabaseInfo, QueryResultColumn } from 'dbgate-types';
|
|
4
|
+
export interface QueryResultTableMapping {
|
|
5
|
+
pureName: string;
|
|
6
|
+
schemaName?: string;
|
|
7
|
+
keyColumns: string[];
|
|
8
|
+
keyDisplayColumns: {
|
|
9
|
+
displayName: string;
|
|
10
|
+
sourceColumnName: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export interface QueryResultColumnBaseMapping {
|
|
14
|
+
pureName: string;
|
|
15
|
+
schemaName?: string;
|
|
16
|
+
sourceColumnName: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function getTableKey(schemaName: string, pureName: string): string;
|
|
19
|
+
export declare function createEditableQueryResultMappings(columns: QueryResultColumn[], dbinfo: DatabaseInfo): {
|
|
20
|
+
editableColumns: Set<string>;
|
|
21
|
+
tableMappings: {
|
|
22
|
+
[key: string]: QueryResultTableMapping;
|
|
23
|
+
};
|
|
24
|
+
columnBaseMappings: {
|
|
25
|
+
[columnName: string]: QueryResultColumnBaseMapping;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function hasCompleteQueryResultKey(mapping: QueryResultTableMapping, row: any): boolean;
|
|
29
|
+
export declare function isEditableQueryResultColumn(columns: DisplayColumn[], tableMappings: {
|
|
30
|
+
[key: string]: QueryResultTableMapping;
|
|
31
|
+
}, uniqueName: string, row?: any): boolean;
|
|
32
|
+
export declare function getEditableQueryResultChangeSetField(columns: DisplayColumn[], tableMappings: {
|
|
33
|
+
[key: string]: QueryResultTableMapping;
|
|
34
|
+
}, row: any, uniqueName: string, insertedRowIndex: any, existingRowIndex?: any): ChangeSetFieldDefinition;
|
|
35
|
+
export declare function getEditableQueryResultChangeSetRowDefinitions(tableMappings: {
|
|
36
|
+
[key: string]: QueryResultTableMapping;
|
|
37
|
+
}, row: any, insertedRowIndex: any, existingRowIndex: any): ChangeSetRowDefinition[];
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getEditableQueryResultChangeSetRowDefinitions = exports.getEditableQueryResultChangeSetField = exports.isEditableQueryResultColumn = exports.hasCompleteQueryResultKey = exports.createEditableQueryResultMappings = exports.getTableKey = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
function getTableKey(schemaName, pureName) {
|
|
9
|
+
return `${schemaName || ''}\n${pureName}`;
|
|
10
|
+
}
|
|
11
|
+
exports.getTableKey = getTableKey;
|
|
12
|
+
function namesEqual(left, right) {
|
|
13
|
+
return left != null && right != null && left.toLowerCase() == right.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
function findTable(dbinfo, schemaName, pureName) {
|
|
16
|
+
if (!(dbinfo === null || dbinfo === void 0 ? void 0 : dbinfo.tables))
|
|
17
|
+
return null;
|
|
18
|
+
if (schemaName) {
|
|
19
|
+
const schemaTable = dbinfo.tables.find(table => table.schemaName == schemaName && table.pureName == pureName) ||
|
|
20
|
+
dbinfo.tables.find(table => namesEqual(table.schemaName, schemaName) && namesEqual(table.pureName, pureName));
|
|
21
|
+
if (schemaTable)
|
|
22
|
+
return schemaTable;
|
|
23
|
+
const uniqueNameTables = dbinfo.tables.filter(table => namesEqual(table.pureName, pureName));
|
|
24
|
+
return uniqueNameTables.length == 1 ? uniqueNameTables[0] : null;
|
|
25
|
+
}
|
|
26
|
+
const tables = dbinfo.tables.filter(table => table.pureName == pureName);
|
|
27
|
+
if (tables.length == 1)
|
|
28
|
+
return tables[0];
|
|
29
|
+
const matchingTables = dbinfo.tables.filter(table => namesEqual(table.pureName, pureName));
|
|
30
|
+
return matchingTables.length == 1 ? matchingTables[0] : null;
|
|
31
|
+
}
|
|
32
|
+
function findColumnName(table, columnName) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
if (!columnName)
|
|
35
|
+
return columnName;
|
|
36
|
+
const exactColumn = (_a = table === null || table === void 0 ? void 0 : table.columns) === null || _a === void 0 ? void 0 : _a.find(column => column.columnName == columnName);
|
|
37
|
+
if (exactColumn)
|
|
38
|
+
return exactColumn.columnName;
|
|
39
|
+
const matchingColumns = ((_b = table === null || table === void 0 ? void 0 : table.columns) === null || _b === void 0 ? void 0 : _b.filter(column => namesEqual(column.columnName, columnName))) || [];
|
|
40
|
+
return matchingColumns.length == 1 ? matchingColumns[0].columnName : columnName;
|
|
41
|
+
}
|
|
42
|
+
function createEditableQueryResultMappings(columns, dbinfo) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
const editableColumns = new Set();
|
|
45
|
+
const tableMappings = {};
|
|
46
|
+
const columnBaseMappings = {};
|
|
47
|
+
const groups = lodash_1.default.groupBy((columns || []).filter(column => column.tableName && column.sourceColumnName), column => getTableKey(column.tableSchema, column.tableName));
|
|
48
|
+
for (const groupColumns of Object.values(groups)) {
|
|
49
|
+
const firstColumn = groupColumns[0];
|
|
50
|
+
const table = findTable(dbinfo, firstColumn.tableSchema, firstColumn.tableName);
|
|
51
|
+
const tableSchema = table ? table.schemaName : firstColumn.tableSchema;
|
|
52
|
+
const tableName = (table === null || table === void 0 ? void 0 : table.pureName) || firstColumn.tableName;
|
|
53
|
+
const normalizedColumns = groupColumns.map(column => (Object.assign(Object.assign({}, column), { sourceColumnName: findColumnName(table, column.sourceColumnName) })));
|
|
54
|
+
const sourceToDisplay = new Map(normalizedColumns.map(column => [column.sourceColumnName, column.columnName]));
|
|
55
|
+
const primaryKeyColumns = ((_b = (_a = table === null || table === void 0 ? void 0 : table.primaryKey) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.map(column => column.columnName)) ||
|
|
56
|
+
normalizedColumns.filter(column => column.isPrimaryKey).map(column => column.sourceColumnName);
|
|
57
|
+
const keyColumns = primaryKeyColumns.length > 0 && primaryKeyColumns.every(columnName => sourceToDisplay.has(columnName))
|
|
58
|
+
? primaryKeyColumns
|
|
59
|
+
: [];
|
|
60
|
+
if (keyColumns.length == 0)
|
|
61
|
+
continue;
|
|
62
|
+
const mapping = {
|
|
63
|
+
pureName: tableName,
|
|
64
|
+
schemaName: tableSchema,
|
|
65
|
+
keyColumns,
|
|
66
|
+
keyDisplayColumns: keyColumns.map(sourceColumnName => ({
|
|
67
|
+
sourceColumnName,
|
|
68
|
+
displayName: sourceToDisplay.get(sourceColumnName),
|
|
69
|
+
})),
|
|
70
|
+
};
|
|
71
|
+
tableMappings[getTableKey(tableSchema, tableName)] = mapping;
|
|
72
|
+
for (const column of normalizedColumns) {
|
|
73
|
+
editableColumns.add(column.columnName);
|
|
74
|
+
columnBaseMappings[column.columnName] = {
|
|
75
|
+
pureName: tableName,
|
|
76
|
+
schemaName: tableSchema,
|
|
77
|
+
sourceColumnName: column.sourceColumnName,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { editableColumns, tableMappings, columnBaseMappings };
|
|
82
|
+
}
|
|
83
|
+
exports.createEditableQueryResultMappings = createEditableQueryResultMappings;
|
|
84
|
+
function hasCompleteQueryResultKey(mapping, row) {
|
|
85
|
+
return mapping.keyDisplayColumns.every(keyColumn => {
|
|
86
|
+
const value = row === null || row === void 0 ? void 0 : row[keyColumn.displayName];
|
|
87
|
+
return value !== null && value !== undefined;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
exports.hasCompleteQueryResultKey = hasCompleteQueryResultKey;
|
|
91
|
+
function getQueryResultCondition(mapping, row) {
|
|
92
|
+
const condition = {};
|
|
93
|
+
for (const keyColumn of mapping.keyDisplayColumns) {
|
|
94
|
+
condition[keyColumn.sourceColumnName] = row === null || row === void 0 ? void 0 : row[keyColumn.displayName];
|
|
95
|
+
}
|
|
96
|
+
return condition;
|
|
97
|
+
}
|
|
98
|
+
function isEditableQueryResultColumn(columns, tableMappings, uniqueName, row) {
|
|
99
|
+
const col = columns.find(column => column.uniqueName == uniqueName);
|
|
100
|
+
if (!(col === null || col === void 0 ? void 0 : col.queryResultEditable))
|
|
101
|
+
return false;
|
|
102
|
+
const mapping = tableMappings[getTableKey(col.schemaName, col.pureName)];
|
|
103
|
+
return !!mapping && hasCompleteQueryResultKey(mapping, row);
|
|
104
|
+
}
|
|
105
|
+
exports.isEditableQueryResultColumn = isEditableQueryResultColumn;
|
|
106
|
+
function getEditableQueryResultChangeSetField(columns, tableMappings, row, uniqueName, insertedRowIndex, existingRowIndex = null) {
|
|
107
|
+
if (insertedRowIndex != null || !isEditableQueryResultColumn(columns, tableMappings, uniqueName, row))
|
|
108
|
+
return null;
|
|
109
|
+
const col = columns.find(column => column.uniqueName == uniqueName);
|
|
110
|
+
if (!col)
|
|
111
|
+
return null;
|
|
112
|
+
const mapping = tableMappings[getTableKey(col.schemaName, col.pureName)];
|
|
113
|
+
if (!mapping)
|
|
114
|
+
return null;
|
|
115
|
+
if (!hasCompleteQueryResultKey(mapping, row))
|
|
116
|
+
return null;
|
|
117
|
+
const condition = getQueryResultCondition(mapping, row);
|
|
118
|
+
if (lodash_1.default.isEmpty(condition))
|
|
119
|
+
return null;
|
|
120
|
+
return {
|
|
121
|
+
pureName: mapping.pureName,
|
|
122
|
+
schemaName: mapping.schemaName,
|
|
123
|
+
existingRowIndex,
|
|
124
|
+
condition,
|
|
125
|
+
uniqueName,
|
|
126
|
+
columnName: col.sourceColumnName,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
exports.getEditableQueryResultChangeSetField = getEditableQueryResultChangeSetField;
|
|
130
|
+
function getEditableQueryResultChangeSetRowDefinitions(tableMappings, row, insertedRowIndex, existingRowIndex) {
|
|
131
|
+
if (insertedRowIndex != null)
|
|
132
|
+
return [];
|
|
133
|
+
return Object.values(tableMappings)
|
|
134
|
+
.filter(mapping => hasCompleteQueryResultKey(mapping, row))
|
|
135
|
+
.map(mapping => {
|
|
136
|
+
return {
|
|
137
|
+
pureName: mapping.pureName,
|
|
138
|
+
schemaName: mapping.schemaName,
|
|
139
|
+
existingRowIndex,
|
|
140
|
+
condition: getQueryResultCondition(mapping, row),
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
exports.getEditableQueryResultChangeSetRowDefinitions = getEditableQueryResultChangeSetRowDefinitions;
|
|
@@ -27,6 +27,7 @@ export declare class FreeTableGridDisplay extends GridDisplay {
|
|
|
27
27
|
isPersisted?: boolean;
|
|
28
28
|
isSparse?: boolean;
|
|
29
29
|
defaultValue?: string;
|
|
30
|
+
onUpdateExpression?: string;
|
|
30
31
|
defaultConstraint?: string;
|
|
31
32
|
columnComment?: string;
|
|
32
33
|
isUnsigned?: boolean;
|
|
@@ -57,6 +58,7 @@ export declare class FreeTableGridDisplay extends GridDisplay {
|
|
|
57
58
|
isPersisted?: boolean;
|
|
58
59
|
isSparse?: boolean;
|
|
59
60
|
defaultValue?: string;
|
|
61
|
+
onUpdateExpression?: string;
|
|
60
62
|
defaultConstraint?: string;
|
|
61
63
|
columnComment?: string;
|
|
62
64
|
isUnsigned?: boolean;
|
package/lib/GridDisplay.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface DisplayColumn {
|
|
|
25
25
|
dataType?: string;
|
|
26
26
|
filterBehaviour?: FilterBehaviour;
|
|
27
27
|
isStructured?: boolean;
|
|
28
|
+
sourceColumnName?: string;
|
|
29
|
+
queryResultEditable?: boolean;
|
|
28
30
|
}
|
|
29
31
|
export interface DisplayedColumnEx extends DisplayColumn {
|
|
30
32
|
sourceAlias: string;
|
|
@@ -59,6 +61,10 @@ export declare abstract class GridDisplay {
|
|
|
59
61
|
groupable: boolean;
|
|
60
62
|
filterable: boolean;
|
|
61
63
|
editable: boolean;
|
|
64
|
+
allowInsert: boolean;
|
|
65
|
+
allowDelete: boolean;
|
|
66
|
+
allowStructureChange: boolean;
|
|
67
|
+
allowRowDocumentEdit: boolean;
|
|
62
68
|
isLoadedCorrectly: boolean;
|
|
63
69
|
supportsReload: boolean;
|
|
64
70
|
isDynamicStructure: boolean;
|
|
@@ -115,8 +121,10 @@ export declare abstract class GridDisplay {
|
|
|
115
121
|
clearFilters(): void;
|
|
116
122
|
resetConfig(): void;
|
|
117
123
|
getChangeSetCondition(row: any): Pick<any, string>;
|
|
124
|
+
isColumnEditable(uniqueName: string, row?: any): boolean;
|
|
118
125
|
getChangeSetField(row: any, uniqueName: any, insertedRowIndex: any, existingRowIndex?: any, baseNameOmitable?: boolean): ChangeSetFieldDefinition;
|
|
119
126
|
getChangeSetRow(row: any, insertedRowIndex: any, existingRowIndex: any, baseNameOmitable?: boolean): ChangeSetRowDefinition;
|
|
127
|
+
getChangeSetRowDefinitions(row: any, insertedRowIndex: any, existingRowIndex: any, baseNameOmitable?: boolean): ChangeSetRowDefinition[];
|
|
120
128
|
createSelect(options?: {}): Select;
|
|
121
129
|
processReferences(select: Select, displayedColumnInfo: DisplayedColumnInfo, options: any): void;
|
|
122
130
|
createColumnExpression(col: any, source: any, alias?: any, purpose?: 'view' | 'filter'): any;
|
package/lib/GridDisplay.js
CHANGED
|
@@ -27,6 +27,10 @@ class GridDisplay {
|
|
|
27
27
|
this.groupable = false;
|
|
28
28
|
this.filterable = false;
|
|
29
29
|
this.editable = false;
|
|
30
|
+
this.allowInsert = true;
|
|
31
|
+
this.allowDelete = true;
|
|
32
|
+
this.allowStructureChange = true;
|
|
33
|
+
this.allowRowDocumentEdit = true;
|
|
30
34
|
this.isLoadedCorrectly = true;
|
|
31
35
|
this.supportsReload = false;
|
|
32
36
|
this.isDynamicStructure = false;
|
|
@@ -406,6 +410,9 @@ class GridDisplay {
|
|
|
406
410
|
return null;
|
|
407
411
|
return lodash_1.default.pick(row, this.changeSetKeyFields);
|
|
408
412
|
}
|
|
413
|
+
isColumnEditable(uniqueName, row) {
|
|
414
|
+
return this.editable;
|
|
415
|
+
}
|
|
409
416
|
getChangeSetField(row, uniqueName, insertedRowIndex, existingRowIndex = null, baseNameOmitable = false) {
|
|
410
417
|
const col = this.columns.find(x => x.uniqueName == uniqueName);
|
|
411
418
|
if (!col)
|
|
@@ -432,6 +439,9 @@ class GridDisplay {
|
|
|
432
439
|
condition: insertedRowIndex == null && existingRowIndex == null ? this.getChangeSetCondition(row) : null,
|
|
433
440
|
};
|
|
434
441
|
}
|
|
442
|
+
getChangeSetRowDefinitions(row, insertedRowIndex, existingRowIndex, baseNameOmitable = false) {
|
|
443
|
+
return [this.getChangeSetRow(row, insertedRowIndex, existingRowIndex, baseNameOmitable)].filter(Boolean);
|
|
444
|
+
}
|
|
435
445
|
createSelect(options = {}) {
|
|
436
446
|
return null;
|
|
437
447
|
}
|
package/lib/JslGridDisplay.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
|
|
2
2
|
import { GridConfig, GridCache } from './GridConfig';
|
|
3
|
-
import { EngineDriver } from 'dbgate-types';
|
|
3
|
+
import { DatabaseInfo, EngineDriver } from 'dbgate-types';
|
|
4
4
|
export declare class JslGridDisplay extends GridDisplay {
|
|
5
|
-
|
|
5
|
+
queryResultEditing: boolean;
|
|
6
|
+
private queryResultTableMappings;
|
|
7
|
+
private queryResultColumnBaseMappings;
|
|
8
|
+
constructor(jslid: any, structure: any, config: GridConfig, setConfig: ChangeConfigFunc, cache: GridCache, setCache: ChangeCacheFunc, rows: any, isDynamicStructure: boolean, supportsReload: boolean, editable?: boolean, driver?: EngineDriver, currentSettings?: any, queryResultEditing?: boolean, dbinfo?: DatabaseInfo);
|
|
9
|
+
private getEditableQueryResultColumns;
|
|
10
|
+
isColumnEditable(uniqueName: string, row?: any): boolean;
|
|
11
|
+
getChangeSetField(row: any, uniqueName: any, insertedRowIndex: any, existingRowIndex?: any, baseNameOmitable?: boolean): import("./ChangeSet").ChangeSetFieldDefinition;
|
|
12
|
+
getChangeSetRowDefinitions(row: any, insertedRowIndex: any, existingRowIndex: any, baseNameOmitable?: boolean): import("./ChangeSet").ChangeSetRowDefinition[];
|
|
6
13
|
}
|
package/lib/JslGridDisplay.js
CHANGED
|
@@ -8,36 +8,80 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
8
8
|
const GridDisplay_1 = require("./GridDisplay");
|
|
9
9
|
const CollectionGridDisplay_1 = require("./CollectionGridDisplay");
|
|
10
10
|
const dbgate_tools_1 = require("dbgate-tools");
|
|
11
|
+
const EditableQueryResultDisplay_1 = require("./EditableQueryResultDisplay");
|
|
11
12
|
class JslGridDisplay extends GridDisplay_1.GridDisplay {
|
|
12
|
-
constructor(jslid, structure, config, setConfig, cache, setCache, rows, isDynamicStructure, supportsReload, editable = false, driver = null, currentSettings = null) {
|
|
13
|
+
constructor(jslid, structure, config, setConfig, cache, setCache, rows, isDynamicStructure, supportsReload, editable = false, driver = null, currentSettings = null, queryResultEditing = false, dbinfo = null) {
|
|
13
14
|
var _a;
|
|
14
|
-
super(config, setConfig, cache, setCache, driver,
|
|
15
|
+
super(config, setConfig, cache, setCache, driver, dbinfo, undefined, currentSettings);
|
|
16
|
+
this.queryResultEditing = queryResultEditing;
|
|
17
|
+
this.queryResultTableMappings = {};
|
|
18
|
+
this.queryResultColumnBaseMappings = {};
|
|
15
19
|
this.filterable = true;
|
|
16
20
|
this.sortable = true;
|
|
17
21
|
this.supportsReload = supportsReload;
|
|
18
22
|
this.isDynamicStructure = isDynamicStructure;
|
|
19
23
|
this.filterBehaviourOverride = dbgate_tools_1.evalFilterBehaviour;
|
|
20
24
|
this.editable = editable;
|
|
21
|
-
this.editableStructure = editable ? structure : null;
|
|
25
|
+
this.editableStructure = editable && !queryResultEditing ? structure : null;
|
|
26
|
+
if (queryResultEditing) {
|
|
27
|
+
this.allowInsert = false;
|
|
28
|
+
this.allowDelete = false;
|
|
29
|
+
this.allowStructureChange = false;
|
|
30
|
+
this.allowRowDocumentEdit = false;
|
|
31
|
+
}
|
|
22
32
|
if (structure === null || structure === void 0 ? void 0 : structure.columns) {
|
|
33
|
+
const queryResultEditableColumns = queryResultEditing
|
|
34
|
+
? this.getEditableQueryResultColumns(structure.columns, dbinfo)
|
|
35
|
+
: new Set();
|
|
23
36
|
this.columns = lodash_1.default.uniqBy((_a = structure.columns
|
|
24
|
-
.map(col =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
.map(col => {
|
|
38
|
+
const columnBaseMapping = this.queryResultColumnBaseMappings[col.columnName];
|
|
39
|
+
return {
|
|
40
|
+
columnName: col.columnName,
|
|
41
|
+
headerText: col.columnName,
|
|
42
|
+
uniqueName: col.columnName,
|
|
43
|
+
uniquePath: [col.columnName],
|
|
44
|
+
notNull: col.notNull,
|
|
45
|
+
autoIncrement: col.autoIncrement,
|
|
46
|
+
pureName: queryResultEditing ? (columnBaseMapping ? columnBaseMapping.pureName : col.tableName) : null,
|
|
47
|
+
schemaName: queryResultEditing ? (columnBaseMapping ? columnBaseMapping.schemaName : col.tableSchema) : null,
|
|
48
|
+
sourceColumnName: columnBaseMapping ? columnBaseMapping.sourceColumnName : col.sourceColumnName,
|
|
49
|
+
queryResultEditable: queryResultEditableColumns.has(col.columnName),
|
|
50
|
+
};
|
|
51
|
+
})) === null || _a === void 0 ? void 0 : _a.map(col => (Object.assign(Object.assign({}, col), { isChecked: this.isColumnChecked(col) }))), col => col.uniqueName);
|
|
34
52
|
}
|
|
35
53
|
if (structure === null || structure === void 0 ? void 0 : structure.__isDynamicStructure) {
|
|
36
54
|
this.columns = (0, CollectionGridDisplay_1.analyseCollectionDisplayColumns)(rows, this);
|
|
37
55
|
}
|
|
38
56
|
if (!this.columns)
|
|
39
57
|
this.columns = [];
|
|
58
|
+
if (queryResultEditing) {
|
|
59
|
+
this.editable = this.columns.some(col => col.queryResultEditable);
|
|
60
|
+
}
|
|
40
61
|
this.formColumns = this.columns;
|
|
41
62
|
}
|
|
63
|
+
getEditableQueryResultColumns(columns, dbinfo) {
|
|
64
|
+
const { editableColumns, tableMappings, columnBaseMappings } = (0, EditableQueryResultDisplay_1.createEditableQueryResultMappings)(columns, dbinfo);
|
|
65
|
+
this.queryResultTableMappings = tableMappings;
|
|
66
|
+
this.queryResultColumnBaseMappings = columnBaseMappings;
|
|
67
|
+
return editableColumns;
|
|
68
|
+
}
|
|
69
|
+
isColumnEditable(uniqueName, row) {
|
|
70
|
+
if (!this.queryResultEditing)
|
|
71
|
+
return super.isColumnEditable(uniqueName, row);
|
|
72
|
+
return (0, EditableQueryResultDisplay_1.isEditableQueryResultColumn)(this.columns, this.queryResultTableMappings, uniqueName, row);
|
|
73
|
+
}
|
|
74
|
+
getChangeSetField(row, uniqueName, insertedRowIndex, existingRowIndex = null, baseNameOmitable = false) {
|
|
75
|
+
if (!this.queryResultEditing) {
|
|
76
|
+
return super.getChangeSetField(row, uniqueName, insertedRowIndex, existingRowIndex, baseNameOmitable);
|
|
77
|
+
}
|
|
78
|
+
return (0, EditableQueryResultDisplay_1.getEditableQueryResultChangeSetField)(this.columns, this.queryResultTableMappings, row, uniqueName, insertedRowIndex, existingRowIndex);
|
|
79
|
+
}
|
|
80
|
+
getChangeSetRowDefinitions(row, insertedRowIndex, existingRowIndex, baseNameOmitable = false) {
|
|
81
|
+
if (!this.queryResultEditing) {
|
|
82
|
+
return super.getChangeSetRowDefinitions(row, insertedRowIndex, existingRowIndex, baseNameOmitable);
|
|
83
|
+
}
|
|
84
|
+
return (0, EditableQueryResultDisplay_1.getEditableQueryResultChangeSetRowDefinitions)(this.queryResultTableMappings, row, insertedRowIndex, existingRowIndex);
|
|
85
|
+
}
|
|
42
86
|
}
|
|
43
87
|
exports.JslGridDisplay = JslGridDisplay;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createQueryResultSaveChangeSet = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const ChangeSet_1 = require("./ChangeSet");
|
|
9
|
+
function createQueryResultSaveChangeSet(changeSet, structure) {
|
|
10
|
+
const res = (0, ChangeSet_1.createChangeSet)();
|
|
11
|
+
const columnMap = lodash_1.default.keyBy(((structure === null || structure === void 0 ? void 0 : structure.columns) || []).filter(column => column.tableName && column.sourceColumnName), 'columnName');
|
|
12
|
+
res.updates = ((changeSet === null || changeSet === void 0 ? void 0 : changeSet.updates) || [])
|
|
13
|
+
.map(update => {
|
|
14
|
+
const fields = {};
|
|
15
|
+
for (const fieldName of Object.keys(update.fields || {})) {
|
|
16
|
+
const column = columnMap[fieldName];
|
|
17
|
+
if (!column)
|
|
18
|
+
continue;
|
|
19
|
+
fields[column.sourceColumnName] = update.fields[fieldName];
|
|
20
|
+
}
|
|
21
|
+
if (lodash_1.default.isEmpty(fields))
|
|
22
|
+
return null;
|
|
23
|
+
return {
|
|
24
|
+
pureName: update.pureName,
|
|
25
|
+
schemaName: update.schemaName,
|
|
26
|
+
condition: update.condition,
|
|
27
|
+
fields,
|
|
28
|
+
};
|
|
29
|
+
})
|
|
30
|
+
.filter(Boolean);
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
exports.createQueryResultSaveChangeSet = createQueryResultSaveChangeSet;
|
package/lib/ViewGridDisplay.d.ts
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
|
|
2
|
-
import type { EngineDriver, ViewInfo, ColumnInfo, DatabaseInfo } from 'dbgate-types';
|
|
2
|
+
import type { EngineDriver, ViewInfo, ColumnInfo, DatabaseInfo, QueryResultColumn } from 'dbgate-types';
|
|
3
3
|
import { GridConfig, GridCache } from './GridConfig';
|
|
4
4
|
export declare class ViewGridDisplay extends GridDisplay {
|
|
5
5
|
view: ViewInfo;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
viewResultInfo: {
|
|
7
|
+
columns?: QueryResultColumn[];
|
|
8
|
+
};
|
|
9
|
+
private queryResultTableMappings;
|
|
10
|
+
private queryResultColumnBaseMappings;
|
|
11
|
+
constructor(view: ViewInfo, driver: EngineDriver, config: GridConfig, setConfig: ChangeConfigFunc, cache: GridCache, setCache: ChangeCacheFunc, dbinfo: DatabaseInfo, serverVersion: any, currentSettings: any, viewResultInfo?: {
|
|
12
|
+
columns?: QueryResultColumn[];
|
|
13
|
+
}, editableView?: boolean);
|
|
14
|
+
private getEditableQueryResultColumns;
|
|
15
|
+
getDisplayColumns(view: ViewInfo, resultColumnMap?: {
|
|
16
|
+
[columnName: string]: QueryResultColumn;
|
|
17
|
+
}, queryResultEditableColumns?: Set<string>): {
|
|
8
18
|
isChecked: boolean;
|
|
9
19
|
pureName: string;
|
|
10
20
|
schemaName: string;
|
|
11
21
|
headerText: string;
|
|
12
22
|
uniqueName: string;
|
|
13
23
|
uniquePath: string[];
|
|
24
|
+
sourceColumnName: string;
|
|
25
|
+
queryResultEditable: boolean;
|
|
14
26
|
pairingId?: string;
|
|
15
27
|
columnName: string;
|
|
16
28
|
notNull?: boolean;
|
|
@@ -24,6 +36,7 @@ export declare class ViewGridDisplay extends GridDisplay {
|
|
|
24
36
|
isPersisted?: boolean;
|
|
25
37
|
isSparse?: boolean;
|
|
26
38
|
defaultValue?: string;
|
|
39
|
+
onUpdateExpression?: string;
|
|
27
40
|
defaultConstraint?: string;
|
|
28
41
|
columnComment?: string;
|
|
29
42
|
isUnsigned?: boolean;
|
|
@@ -35,12 +48,14 @@ export declare class ViewGridDisplay extends GridDisplay {
|
|
|
35
48
|
contentHash?: string;
|
|
36
49
|
engine?: string;
|
|
37
50
|
}[];
|
|
38
|
-
getDisplayColumn(view: ViewInfo, col: ColumnInfo): {
|
|
51
|
+
getDisplayColumn(view: ViewInfo, col: ColumnInfo, resultColumn?: QueryResultColumn, queryResultEditableColumns?: Set<string>): {
|
|
39
52
|
pureName: string;
|
|
40
53
|
schemaName: string;
|
|
41
54
|
headerText: string;
|
|
42
55
|
uniqueName: string;
|
|
43
56
|
uniquePath: string[];
|
|
57
|
+
sourceColumnName: string;
|
|
58
|
+
queryResultEditable: boolean;
|
|
44
59
|
pairingId?: string;
|
|
45
60
|
columnName: string;
|
|
46
61
|
notNull?: boolean;
|
|
@@ -54,6 +69,7 @@ export declare class ViewGridDisplay extends GridDisplay {
|
|
|
54
69
|
isPersisted?: boolean;
|
|
55
70
|
isSparse?: boolean;
|
|
56
71
|
defaultValue?: string;
|
|
72
|
+
onUpdateExpression?: string;
|
|
57
73
|
defaultConstraint?: string;
|
|
58
74
|
columnComment?: string;
|
|
59
75
|
isUnsigned?: boolean;
|
|
@@ -65,5 +81,8 @@ export declare class ViewGridDisplay extends GridDisplay {
|
|
|
65
81
|
contentHash?: string;
|
|
66
82
|
engine?: string;
|
|
67
83
|
};
|
|
84
|
+
isColumnEditable(uniqueName: string, row?: any): boolean;
|
|
85
|
+
getChangeSetField(row: any, uniqueName: any, insertedRowIndex: any, existingRowIndex?: any, baseNameOmitable?: boolean): import("./ChangeSet").ChangeSetFieldDefinition;
|
|
86
|
+
getChangeSetRowDefinitions(row: any, insertedRowIndex: any, existingRowIndex: any, baseNameOmitable?: boolean): import("./ChangeSet").ChangeSetRowDefinition[];
|
|
68
87
|
createSelect(options?: {}): import("dbgate-sqltree").Select;
|
|
69
88
|
}
|
package/lib/ViewGridDisplay.js
CHANGED
|
@@ -1,29 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ViewGridDisplay = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
4
8
|
const GridDisplay_1 = require("./GridDisplay");
|
|
9
|
+
const EditableQueryResultDisplay_1 = require("./EditableQueryResultDisplay");
|
|
5
10
|
class ViewGridDisplay extends GridDisplay_1.GridDisplay {
|
|
6
|
-
constructor(view, driver, config, setConfig, cache, setCache, dbinfo, serverVersion, currentSettings) {
|
|
11
|
+
constructor(view, driver, config, setConfig, cache, setCache, dbinfo, serverVersion, currentSettings, viewResultInfo = null, editableView = false) {
|
|
12
|
+
var _a;
|
|
7
13
|
super(config, setConfig, cache, setCache, driver, dbinfo, serverVersion, currentSettings);
|
|
8
14
|
this.view = view;
|
|
9
|
-
this.
|
|
15
|
+
this.viewResultInfo = viewResultInfo;
|
|
16
|
+
this.queryResultTableMappings = {};
|
|
17
|
+
this.queryResultColumnBaseMappings = {};
|
|
18
|
+
const effectiveEditable = editableView && ((_a = driver === null || driver === void 0 ? void 0 : driver.databaseEngineTypes) === null || _a === void 0 ? void 0 : _a.includes('sql')) && (driver === null || driver === void 0 ? void 0 : driver.supportsEditableQueryResults);
|
|
19
|
+
const queryResultEditableColumns = effectiveEditable
|
|
20
|
+
? this.getEditableQueryResultColumns((viewResultInfo === null || viewResultInfo === void 0 ? void 0 : viewResultInfo.columns) || [], dbinfo)
|
|
21
|
+
: new Set();
|
|
22
|
+
const resultColumnMap = lodash_1.default.keyBy((viewResultInfo === null || viewResultInfo === void 0 ? void 0 : viewResultInfo.columns) || [], 'columnName');
|
|
23
|
+
this.columns = this.getDisplayColumns(view, resultColumnMap, queryResultEditableColumns);
|
|
10
24
|
this.formColumns = this.columns;
|
|
11
25
|
this.filterable = true;
|
|
12
26
|
this.sortable = true;
|
|
13
27
|
this.groupable = false;
|
|
14
|
-
this.editable =
|
|
28
|
+
this.editable = effectiveEditable && this.columns.some(col => col.queryResultEditable);
|
|
29
|
+
if (effectiveEditable) {
|
|
30
|
+
this.allowInsert = false;
|
|
31
|
+
this.allowDelete = false;
|
|
32
|
+
this.allowStructureChange = false;
|
|
33
|
+
this.allowRowDocumentEdit = false;
|
|
34
|
+
}
|
|
15
35
|
this.supportsReload = true;
|
|
16
36
|
this.baseView = view;
|
|
17
37
|
}
|
|
18
|
-
|
|
38
|
+
getEditableQueryResultColumns(columns, dbinfo) {
|
|
39
|
+
const { editableColumns, tableMappings, columnBaseMappings } = (0, EditableQueryResultDisplay_1.createEditableQueryResultMappings)(columns, dbinfo);
|
|
40
|
+
this.queryResultTableMappings = tableMappings;
|
|
41
|
+
this.queryResultColumnBaseMappings = columnBaseMappings;
|
|
42
|
+
return editableColumns;
|
|
43
|
+
}
|
|
44
|
+
getDisplayColumns(view, resultColumnMap = {}, queryResultEditableColumns = new Set()) {
|
|
19
45
|
var _a, _b;
|
|
20
|
-
return (((_b = (_a = view === null || view === void 0 ? void 0 : view.columns) === null || _a === void 0 ? void 0 : _a.map(col => this.getDisplayColumn(view, col))) === null || _b === void 0 ? void 0 : _b.map(col => (Object.assign(Object.assign({}, col), { isChecked: this.isColumnChecked(col) })))) || []);
|
|
46
|
+
return (((_b = (_a = view === null || view === void 0 ? void 0 : view.columns) === null || _a === void 0 ? void 0 : _a.map(col => this.getDisplayColumn(view, col, resultColumnMap[col.columnName], queryResultEditableColumns))) === null || _b === void 0 ? void 0 : _b.map(col => (Object.assign(Object.assign({}, col), { isChecked: this.isColumnChecked(col) })))) || []);
|
|
21
47
|
}
|
|
22
|
-
getDisplayColumn(view, col) {
|
|
48
|
+
getDisplayColumn(view, col, resultColumn = null, queryResultEditableColumns = new Set()) {
|
|
23
49
|
const uniquePath = [col.columnName];
|
|
24
50
|
const uniqueName = uniquePath.join('.');
|
|
25
|
-
|
|
26
|
-
|
|
51
|
+
const columnBaseMapping = this.queryResultColumnBaseMappings[col.columnName];
|
|
52
|
+
return Object.assign(Object.assign({}, col), { pureName: columnBaseMapping ? columnBaseMapping.pureName : (resultColumn === null || resultColumn === void 0 ? void 0 : resultColumn.tableName) || view.pureName, schemaName: columnBaseMapping ? columnBaseMapping.schemaName : (resultColumn === null || resultColumn === void 0 ? void 0 : resultColumn.tableSchema) || view.schemaName, headerText: col.columnName, uniqueName,
|
|
53
|
+
uniquePath, sourceColumnName: columnBaseMapping ? columnBaseMapping.sourceColumnName : resultColumn === null || resultColumn === void 0 ? void 0 : resultColumn.sourceColumnName, queryResultEditable: queryResultEditableColumns.has(col.columnName) });
|
|
54
|
+
}
|
|
55
|
+
isColumnEditable(uniqueName, row) {
|
|
56
|
+
if (!this.editable)
|
|
57
|
+
return false;
|
|
58
|
+
return (0, EditableQueryResultDisplay_1.isEditableQueryResultColumn)(this.columns, this.queryResultTableMappings, uniqueName, row);
|
|
59
|
+
}
|
|
60
|
+
getChangeSetField(row, uniqueName, insertedRowIndex, existingRowIndex = null, baseNameOmitable = false) {
|
|
61
|
+
return (0, EditableQueryResultDisplay_1.getEditableQueryResultChangeSetField)(this.columns, this.queryResultTableMappings, row, uniqueName, insertedRowIndex, existingRowIndex);
|
|
62
|
+
}
|
|
63
|
+
getChangeSetRowDefinitions(row, insertedRowIndex, existingRowIndex, baseNameOmitable = false) {
|
|
64
|
+
return (0, EditableQueryResultDisplay_1.getEditableQueryResultChangeSetRowDefinitions)(this.queryResultTableMappings, row, insertedRowIndex, existingRowIndex);
|
|
27
65
|
}
|
|
28
66
|
createSelect(options = {}) {
|
|
29
67
|
const select = this.createSelectBase(this.view, this.view.columns, options);
|
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from './PerspectiveTreeNode';
|
|
|
5
5
|
export * from './TableGridDisplay';
|
|
6
6
|
export * from './ViewGridDisplay';
|
|
7
7
|
export * from './JslGridDisplay';
|
|
8
|
+
export * from './QueryResultChangeSet';
|
|
9
|
+
export * from './EditableQueryResultDisplay';
|
|
8
10
|
export * from './ChangeSet';
|
|
9
11
|
export * from './MacroDefinition';
|
|
10
12
|
export * from './runMacro';
|
package/lib/index.js
CHANGED
|
@@ -21,6 +21,8 @@ __exportStar(require("./PerspectiveTreeNode"), exports);
|
|
|
21
21
|
__exportStar(require("./TableGridDisplay"), exports);
|
|
22
22
|
__exportStar(require("./ViewGridDisplay"), exports);
|
|
23
23
|
__exportStar(require("./JslGridDisplay"), exports);
|
|
24
|
+
__exportStar(require("./QueryResultChangeSet"), exports);
|
|
25
|
+
__exportStar(require("./EditableQueryResultDisplay"), exports);
|
|
24
26
|
__exportStar(require("./ChangeSet"), exports);
|
|
25
27
|
__exportStar(require("./MacroDefinition"), exports);
|
|
26
28
|
__exportStar(require("./runMacro"), exports);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.1
|
|
2
|
+
"version": "7.2.1",
|
|
3
3
|
"name": "dbgate-datalib",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"date-fns": "^4.1.0",
|
|
22
|
-
"dbgate-filterparser": "7.1
|
|
23
|
-
"dbgate-sqltree": "7.1
|
|
24
|
-
"dbgate-tools": "7.1
|
|
22
|
+
"dbgate-filterparser": "7.2.1",
|
|
23
|
+
"dbgate-sqltree": "7.2.1",
|
|
24
|
+
"dbgate-tools": "7.2.1",
|
|
25
25
|
"uuid": "^3.4.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^13.7.0",
|
|
29
|
-
"dbgate-types": "7.1
|
|
29
|
+
"dbgate-types": "7.2.1",
|
|
30
30
|
"jest": "^28.1.3",
|
|
31
31
|
"ts-jest": "^28.0.7",
|
|
32
32
|
"typescript": "^4.4.3"
|