myt/exporters/view.js

30 lines
667 B
JavaScript
Raw Permalink Normal View History

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',
defaults: {
securityType: 'DEFINER',
checkOption: 'NONE'
},
2022-02-02 04:05:31 +00:00
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
}
};