migrating to typescript

This commit is contained in:
Anatoly 2018-09-11 23:57:01 +03:00
parent 92126dcf0c
commit 6ee6a047b6
4 changed files with 17 additions and 5 deletions

View file

@ -40,10 +40,14 @@ async function getColumnTypes(testSchemaProcessor: TestSchemaProcessor): Promise
logTitle,
sql,
DBVendors.PG,
true,
false,
false
);
if (result.error) {
testSchemaProcessor.processFatalError(result.error);
}
return result.data.rows;
}

View file

@ -37,10 +37,14 @@ async function retrieveData(testSchemaProcessor: TestSchemaProcessor): Promise<a
logTitle,
sql,
DBVendors.PG,
true,
false,
false
);
if (result.error) {
testSchemaProcessor.processFatalError(result.error);
}
return result.data.rows[0];
}

View file

@ -37,10 +37,14 @@ async function hasSchemaCreated(testSchemaProcessor: TestSchemaProcessor): Promi
logTitle,
sql,
DBVendors.PG,
true,
false,
false
);
if (result.error) {
testSchemaProcessor.processFatalError(result.error);
}
return !!result.data.rows[0].exists;
}

View file

@ -61,9 +61,9 @@ export default class TestSchemaProcessor {
/**
* Stops the process in case of fatal error.
*/
public processFatalError(conversion: Conversion, error: string): void {
public processFatalError(error: string): void {
console.log(error);
generateError(conversion, error);
generateError(<Conversion>this.conversion, error);
process.exit();
}