@itrocks/mysql-maintainer 0.0.4 → 0.0.5
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/cjs/mysql-maintainer.js
CHANGED
|
@@ -15,11 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.MysqlMaintainer = void 0;
|
|
18
|
-
const class_to_table_1 = require("@itrocks/class-to-table");
|
|
19
18
|
const class_type_1 = require("@itrocks/class-type");
|
|
20
|
-
const
|
|
19
|
+
const mysql_to_schema_1 = require("@itrocks/mysql-to-schema");
|
|
20
|
+
const reflect_to_schema_1 = require("@itrocks/reflect-to-schema");
|
|
21
|
+
const schema_diff_1 = require("@itrocks/schema-diff");
|
|
21
22
|
const store_1 = require("@itrocks/store");
|
|
22
|
-
const table_schema_diff_1 = require("@itrocks/table-schema-diff");
|
|
23
23
|
__exportStar(require("./mysql"), exports);
|
|
24
24
|
class MysqlMaintainer {
|
|
25
25
|
connection;
|
|
@@ -68,16 +68,16 @@ class MysqlMaintainer {
|
|
|
68
68
|
}
|
|
69
69
|
console.log('##### UPDATE TABLE');
|
|
70
70
|
console.log('class table before normalize:');
|
|
71
|
-
const classTable = new
|
|
71
|
+
const classTable = new reflect_to_schema_1.ReflectToTable().convert(type);
|
|
72
72
|
console.dir(classTable, { depth: null });
|
|
73
73
|
console.log('class table after normalize:');
|
|
74
|
-
new
|
|
74
|
+
new mysql_to_schema_1.MysqlToTable(this.connection).normalize(classTable);
|
|
75
75
|
console.dir(classTable, { depth: null });
|
|
76
76
|
console.log('mysql table:');
|
|
77
|
-
const mysqlTable = await ((new
|
|
77
|
+
const mysqlTable = await ((new mysql_to_schema_1.MysqlToTable(this.connection)).convert(tableName));
|
|
78
78
|
console.dir(mysqlTable, { depth: null });
|
|
79
79
|
console.log('table diff:');
|
|
80
|
-
const tableSchemaDiff = new
|
|
80
|
+
const tableSchemaDiff = new schema_diff_1.TableDiff(mysqlTable, classTable);
|
|
81
81
|
console.dir(tableSchemaDiff, { depth: null });
|
|
82
82
|
return false;
|
|
83
83
|
}
|
package/esm/mysql-maintainer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ClassToTable } from '@itrocks/class-to-table';
|
|
2
1
|
import { typeOf } from '@itrocks/class-type';
|
|
3
|
-
import { MysqlToTable } from '@itrocks/mysql-to-
|
|
2
|
+
import { MysqlToTable } from '@itrocks/mysql-to-schema';
|
|
3
|
+
import { ReflectToTable } from '@itrocks/reflect-to-schema';
|
|
4
|
+
import { TableDiff } from '@itrocks/schema-diff';
|
|
4
5
|
import { storeOf } from '@itrocks/store';
|
|
5
|
-
import { TableSchemaDiff } from '@itrocks/table-schema-diff';
|
|
6
6
|
export * from './mysql';
|
|
7
7
|
export class MysqlMaintainer {
|
|
8
8
|
connection;
|
|
@@ -51,7 +51,7 @@ export class MysqlMaintainer {
|
|
|
51
51
|
}
|
|
52
52
|
console.log('##### UPDATE TABLE');
|
|
53
53
|
console.log('class table before normalize:');
|
|
54
|
-
const classTable = new
|
|
54
|
+
const classTable = new ReflectToTable().convert(type);
|
|
55
55
|
console.dir(classTable, { depth: null });
|
|
56
56
|
console.log('class table after normalize:');
|
|
57
57
|
new MysqlToTable(this.connection).normalize(classTable);
|
|
@@ -60,7 +60,7 @@ export class MysqlMaintainer {
|
|
|
60
60
|
const mysqlTable = await ((new MysqlToTable(this.connection)).convert(tableName));
|
|
61
61
|
console.dir(mysqlTable, { depth: null });
|
|
62
62
|
console.log('table diff:');
|
|
63
|
-
const tableSchemaDiff = new
|
|
63
|
+
const tableSchemaDiff = new TableDiff(mysqlTable, classTable);
|
|
64
64
|
console.dir(tableSchemaDiff, { depth: null });
|
|
65
65
|
return false;
|
|
66
66
|
}
|
package/package.json
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"email": "baptiste@pillot.fr"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@itrocks/class-to-table": "latest",
|
|
8
7
|
"@itrocks/class-type": "latest",
|
|
9
8
|
"@itrocks/mysql": "latest",
|
|
10
|
-
"@itrocks/mysql-to-
|
|
9
|
+
"@itrocks/mysql-to-schema": "latest",
|
|
11
10
|
"@itrocks/reflect": "latest",
|
|
11
|
+
"@itrocks/reflect-to-schema": "latest",
|
|
12
|
+
"@itrocks/schema-diff": "latest",
|
|
12
13
|
"@itrocks/storage": "latest",
|
|
13
14
|
"@itrocks/store": "latest",
|
|
14
|
-
"@itrocks/table-schema-diff": "latest",
|
|
15
15
|
"mariadb": "^3.4"
|
|
16
16
|
},
|
|
17
17
|
"description": "Reactively maintains database structure by updating schema and retrying on MySQL errors",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"build:esm": "tsc -p tsconfig.esm.json"
|
|
54
54
|
},
|
|
55
55
|
"types": "./esm/mysql-maintainer.d.ts",
|
|
56
|
-
"version": "0.0.
|
|
56
|
+
"version": "0.0.5"
|
|
57
57
|
}
|