dbgate-tools 5.1.5 → 5.1.7-alpha.13
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/SqlDumper.d.ts +1 -1
- package/lib/SqlGenerator.d.ts +1 -1
- package/lib/computeDiffRows.d.ts +1 -1
- package/lib/diffTools.d.ts +1 -1
- package/lib/filterName.js +17 -51
- package/lib/nameTools.d.ts +1 -1
- package/lib/packageTools.d.ts +1 -1
- package/lib/preloadedRowsTools.d.ts +1 -1
- package/lib/schemaEditorTools.d.ts +1 -1
- package/lib/structureTools.d.ts +1 -1
- package/lib/tableTransforms.d.ts +1 -1
- package/package.json +4 -4
package/lib/SqlDumper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnInfo, ConstraintInfo, EngineDriver, ForeignKeyInfo, FunctionInfo, NamedObjectInfo, PrimaryKeyInfo, ProcedureInfo, SqlDialect, TableInfo, TransformType, TriggerInfo, ViewInfo, IndexInfo, UniqueInfo, CheckInfo, AlterProcessor, SqlObjectInfo } from 'dbgate-types';
|
|
1
|
+
import type { ColumnInfo, ConstraintInfo, EngineDriver, ForeignKeyInfo, FunctionInfo, NamedObjectInfo, PrimaryKeyInfo, ProcedureInfo, SqlDialect, TableInfo, TransformType, TriggerInfo, ViewInfo, IndexInfo, UniqueInfo, CheckInfo, AlterProcessor, SqlObjectInfo } from 'dbgate-types';
|
|
2
2
|
export declare class SqlDumper implements AlterProcessor {
|
|
3
3
|
s: string;
|
|
4
4
|
driver: EngineDriver;
|
package/lib/SqlGenerator.d.ts
CHANGED
package/lib/computeDiffRows.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DbDiffOptions, testEqualTables, testEqualSqlObjects } from './diffTools';
|
|
2
|
-
import { DatabaseInfo, EngineDriver, SqlObjectInfo, TableInfo } from 'dbgate-types';
|
|
2
|
+
import type { DatabaseInfo, EngineDriver, SqlObjectInfo, TableInfo } from 'dbgate-types';
|
|
3
3
|
export declare function computeDiffRowsCore(sourceList: any, targetList: any, testEqual: any): any[];
|
|
4
4
|
export declare const DbDiffCompareDefs: {
|
|
5
5
|
tables: {
|
package/lib/diffTools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnInfo, DatabaseInfo, EngineDriver, SqlObjectInfo, TableInfo } from 'dbgate-types';
|
|
1
|
+
import type { ColumnInfo, DatabaseInfo, EngineDriver, SqlObjectInfo, TableInfo } from 'dbgate-types';
|
|
2
2
|
import { AlterPlan } from './alterPlan';
|
|
3
3
|
declare type DbDiffSchemaMode = 'strict' | 'ignore' | 'ignoreImplicit';
|
|
4
4
|
export interface DbDiffOptions {
|
package/lib/filterName.js
CHANGED
|
@@ -6,55 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.filterName = void 0;
|
|
7
7
|
const compact_1 = __importDefault(require("lodash/compact"));
|
|
8
8
|
const isString_1 = __importDefault(require("lodash/isString"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// if (String.IsNullOrEmpty(Filter)) return false;
|
|
13
|
-
// if (String.IsNullOrEmpty(value)) return true;
|
|
14
|
-
// var camelVariants = new HashSet<string>();
|
|
15
|
-
// camelVariants.Add(new String(value.Where(Char.IsUpper).ToArray()));
|
|
16
|
-
// if (value.All(x => Char.IsUpper(x) || x == '_'))
|
|
17
|
-
// {
|
|
18
|
-
// var sb = new StringBuilder();
|
|
19
|
-
// for (int i = 0; i < value.Length; i++)
|
|
20
|
-
// {
|
|
21
|
-
// if (Char.IsUpper(value[i]) && (i == 0 || value[i - 1] == '_')) sb.Append(value[i]);
|
|
22
|
-
// }
|
|
23
|
-
// camelVariants.Add(sb.ToString());
|
|
24
|
-
// }
|
|
25
|
-
// else
|
|
26
|
-
// {
|
|
27
|
-
// string s = value, s0;
|
|
28
|
-
// do
|
|
29
|
-
// {
|
|
30
|
-
// s0 = s;
|
|
31
|
-
// s = Regex.Replace(s, "([A-Z])([A-Z])([A-Z])", "$1$3");
|
|
32
|
-
// } while (s0 != s);
|
|
33
|
-
// camelVariants.Add(new String(s.Where(Char.IsUpper).ToArray()));
|
|
34
|
-
// }
|
|
35
|
-
// bool camelMatch = camelVariants.Any(x => DoMatch(Filter, x));
|
|
36
|
-
// if (Filter.All(Char.IsUpper)) return camelMatch;
|
|
37
|
-
// return DoMatch(Filter, value) || camelMatch;
|
|
38
|
-
// }
|
|
39
|
-
function fuzzysearch(needle, haystack) {
|
|
40
|
-
var hlen = haystack.length;
|
|
41
|
-
var nlen = needle.length;
|
|
42
|
-
if (nlen > hlen) {
|
|
9
|
+
const startCase_1 = __importDefault(require("lodash/startCase"));
|
|
10
|
+
function camelMatch(filter, text) {
|
|
11
|
+
if (!text)
|
|
43
12
|
return false;
|
|
13
|
+
if (!filter)
|
|
14
|
+
return true;
|
|
15
|
+
if (filter.replace(/[A-Z]/g, '').length == 0) {
|
|
16
|
+
const textCapitals = (0, startCase_1.default)(text).replace(/[^A-Z]/g, '');
|
|
17
|
+
const pattern = '.*' + filter.split('').join('.*') + '.*';
|
|
18
|
+
const re = new RegExp(pattern);
|
|
19
|
+
return re.test(textCapitals);
|
|
44
20
|
}
|
|
45
|
-
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
outer: for (var i = 0, j = 0; i < nlen; i++) {
|
|
49
|
-
var nch = needle.charCodeAt(i);
|
|
50
|
-
while (j < hlen) {
|
|
51
|
-
if (haystack.charCodeAt(j++) === nch) {
|
|
52
|
-
continue outer;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
21
|
+
else {
|
|
22
|
+
return text.toUpperCase().includes(filter.toUpperCase());
|
|
56
23
|
}
|
|
57
|
-
return true;
|
|
58
24
|
}
|
|
59
25
|
function filterName(filter, ...names) {
|
|
60
26
|
if (!filter)
|
|
@@ -67,15 +33,15 @@ function filterName(filter, ...names) {
|
|
|
67
33
|
// @ts-ignore
|
|
68
34
|
const namesChild = namesCompacted.filter(x => x.childName).map(x => x.childName);
|
|
69
35
|
for (const token of tokens) {
|
|
70
|
-
const tokenUpper = token.toUpperCase();
|
|
71
|
-
if (
|
|
72
|
-
const tokenUpperSub = tokenUpper.substring(1);
|
|
73
|
-
const found = namesChild.find(name =>
|
|
36
|
+
// const tokenUpper = token.toUpperCase();
|
|
37
|
+
if (token.startsWith('#')) {
|
|
38
|
+
// const tokenUpperSub = tokenUpper.substring(1);
|
|
39
|
+
const found = namesChild.find(name => camelMatch(token.substring(1), name));
|
|
74
40
|
if (!found)
|
|
75
41
|
return false;
|
|
76
42
|
}
|
|
77
43
|
else {
|
|
78
|
-
const found = namesOwn.find(name =>
|
|
44
|
+
const found = namesOwn.find(name => camelMatch(token, name));
|
|
79
45
|
if (!found)
|
|
80
46
|
return false;
|
|
81
47
|
}
|
package/lib/nameTools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnInfo, DatabaseInfo, DatabaseInfoObjects, NamedObjectInfo, SqlDialect, TableInfo } from 'dbgate-types';
|
|
1
|
+
import type { ColumnInfo, DatabaseInfo, DatabaseInfoObjects, NamedObjectInfo, SqlDialect, TableInfo } from 'dbgate-types';
|
|
2
2
|
export declare function fullNameFromString(name: any): {
|
|
3
3
|
schemaName: any;
|
|
4
4
|
pureName: any;
|
package/lib/packageTools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EngineDriver, ExtensionsDirectory } from 'dbgate-types';
|
|
1
|
+
import type { EngineDriver, ExtensionsDirectory } from 'dbgate-types';
|
|
2
2
|
export declare function extractShellApiPlugins(functionName: any, props: any): string[];
|
|
3
3
|
export declare function extractPackageName(name: any): string;
|
|
4
4
|
export declare function extractShellApiFunctionName(functionName: any): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DatabaseInfo, EngineDriver } from 'dbgate-types';
|
|
1
|
+
import type { DatabaseInfo, EngineDriver } from 'dbgate-types';
|
|
2
2
|
export declare function enrichWithPreloadedRows(dbModel: DatabaseInfo, dbTarget: DatabaseInfo, conn: any, driver: EngineDriver): Promise<DatabaseInfo>;
|
package/lib/structureTools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatabaseInfo, TableInfo, ApplicationDefinition, ViewInfo, CollectionInfo } from 'dbgate-types';
|
|
1
|
+
import type { DatabaseInfo, TableInfo, ApplicationDefinition, ViewInfo, CollectionInfo } from 'dbgate-types';
|
|
2
2
|
export declare function addTableDependencies(db: DatabaseInfo): DatabaseInfo;
|
|
3
3
|
export declare function extendTableInfo(table: TableInfo): TableInfo;
|
|
4
4
|
export declare function extendDatabaseInfo(db: DatabaseInfo): DatabaseInfo;
|
package/lib/tableTransforms.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.1.
|
|
2
|
+
"version": "5.1.7-alpha.13",
|
|
3
3
|
"name": "dbgate-tools",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^13.7.0",
|
|
28
|
-
"dbgate-types": "^5.1.
|
|
28
|
+
"dbgate-types": "^5.1.7-alpha.13",
|
|
29
29
|
"jest": "^24.9.0",
|
|
30
30
|
"ts-jest": "^25.2.1",
|
|
31
31
|
"typescript": "^4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"dbgate-query-splitter": "^4.9.
|
|
35
|
-
"dbgate-sqltree": "^5.1.
|
|
34
|
+
"dbgate-query-splitter": "^4.9.3",
|
|
35
|
+
"dbgate-sqltree": "^5.1.7-alpha.13",
|
|
36
36
|
"debug": "^4.3.4",
|
|
37
37
|
"json-stable-stringify": "^1.0.1",
|
|
38
38
|
"lodash": "^4.17.21",
|