2020-11-14 01:38:56 +00:00
|
|
|
|
|
|
|
const sqlFormatter = require('@sqltools/formatter');
|
|
|
|
|
2022-02-02 04:05:31 +00:00
|
|
|
module.exports = {
|
|
|
|
schemaCol: 'TABLE_SCHEMA',
|
|
|
|
nameCol: 'TABLE_NAME',
|
|
|
|
formatter(params) {
|
|
|
|
params.definition = sqlFormatter.format(params.definition, {
|
|
|
|
indent: '\t',
|
|
|
|
reservedWordCase: 'upper'
|
|
|
|
});
|
2022-02-07 14:43:12 +00:00
|
|
|
|
|
|
|
let algorithm;
|
|
|
|
switch (params.isUpdatable) {
|
|
|
|
case 'YES':
|
|
|
|
algorithm = 'MERGE';
|
|
|
|
break;
|
|
|
|
case 'NO':
|
|
|
|
algorithm = 'TEMPTABLE';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
algorithm = 'UNDEFINED';
|
|
|
|
}
|
2022-02-02 04:05:31 +00:00
|
|
|
}
|
|
|
|
};
|