This repository was archived by the owner on Oct 25, 2022. It is now read-only.
forked from Mohd-Taqiuddin/MYSQL-to-Kwil-migration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
45 lines (41 loc) · 1.19 KB
/
index.js
File metadata and controls
45 lines (41 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const prompts = require("prompts");
const configs_1 = require("./configs");
const migrate_1 = require("./lib/migrate");
const mysqlPrompts = [
{
type: 'text',
name: 'mysqlhost',
message: 'MySQL database host address?',
initial: '127.0.0.1',
},
{
type: 'text',
name: 'mysqlusername',
message: 'MySQL database authentication username?',
initial: 'root',
},
{
type: 'password',
name: 'mysqlpassword',
message: 'MySQL database authentication password?',
},
{
type: 'text',
name: 'mysqldatabase',
message: 'MySQL database name?',
},
];
(async () => {
// @ts-ignore
const mysqlConn = new configs_1.Database(configs_1.mysqlConfig(await prompts(mysqlPrompts)));
// @ts-ignore
const migrate = new migrate_1.Migrate({ mysqlconn: mysqlConn });
await migrate.retrieveModels();
await migrate.retrieveMysqlData();
// @ts-ignore
await migrate.generateKwilSchemas();
await migrate.populateKwil().catch(e => {console.log(e); process.exit();});
})();