Skip to content

Commit 75f65d9

Browse files
committed
Remove legacy code
1 parent 0e7847b commit 75f65d9

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/service/dump/mysql/getSchemaDump.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import * as sqlformatter from 'sql-formatter';
2-
31
import { SchemaDumpOptions } from './interfaces/Options';
42
import { Table } from './interfaces/Table';
53
import { DB } from './DB';
@@ -20,15 +18,7 @@ function isCreateView(v: ShowCreateTableStatementRes): v is ShowCreateView {
2018
return 'View' in v;
2119
}
2220

23-
async function getSchemaDump(
24-
connection: DB,
25-
options: Required<SchemaDumpOptions>,
26-
tables: Array<Table>,
27-
): Promise<Array<Table>> {
28-
const format = options.format
29-
? (sql: string) => sqlformatter.format(sql)
30-
: (sql: string) => sql;
31-
21+
async function getSchemaDump( connection: DB, options: Required<SchemaDumpOptions>, tables: Array<Table> ): Promise<Array<Table>> {
3222
// we create a multi query here so we can query all at once rather than in individual connections
3323
const getSchemaMultiQuery = tables
3424
.map(t => `SHOW CREATE TABLE \`${t.name}\`;`)
@@ -44,7 +34,7 @@ async function getSchemaDump(
4434
return {
4535
...table,
4636
name: res.View,
47-
schema: format(res['Create View']),
37+
schema: res['Create View'],
4838
data: null,
4939
isView: true,
5040
};
@@ -53,7 +43,7 @@ async function getSchemaDump(
5343
return {
5444
...table,
5545
name: res.Table,
56-
schema: format(res['Create Table']),
46+
schema: res['Create Table'],
5747
data: null,
5848
isView: false,
5949
};

0 commit comments

Comments
 (0)