mirror of https://github.com/Fabio286/antares.git
fix: missing schema when queryng INFORMATION_SCHEMA
This commit is contained in:
parent
530907d097
commit
530d1bd43f
|
@ -20,6 +20,7 @@ export default connections => {
|
|||
|
||||
try {
|
||||
await InformationSchema.testConnection(Connection);
|
||||
Connection.destroy();
|
||||
|
||||
return { status: 'success' };
|
||||
}
|
||||
|
@ -49,6 +50,7 @@ export default connections => {
|
|||
|
||||
const { rows: structure } = await InformationSchema.getStructure(Connection);
|
||||
connections[conn.uid] = Connection;
|
||||
|
||||
return { status: 'success', response: structure };
|
||||
}
|
||||
catch (err) {
|
||||
|
|
|
@ -92,7 +92,10 @@ export default {
|
|||
|
||||
if (resultsWithRows[index] && resultsWithRows[index].fields && resultsWithRows[index].fields.length) {
|
||||
return resultsWithRows[index].fields.map(field => {
|
||||
return { table: field.orgTable, schema: field.db };
|
||||
return {
|
||||
table: field.orgTable,
|
||||
schema: field.db || 'INFORMATION_SCHEMA'
|
||||
};
|
||||
}).filter((val, i, arr) => arr.findIndex(el => el.schema === val.schema && el.table === val.table) === i);
|
||||
}
|
||||
return [];
|
||||
|
|
|
@ -285,7 +285,9 @@ export default {
|
|||
field.name === cKey ||
|
||||
field.alias === cKey ||
|
||||
`${field.table}.${field.name}` === cKey ||
|
||||
`${field.table}.${field.alias}` === cKey)[0];
|
||||
`${field.table}.${field.alias}` === cKey ||
|
||||
`${field.table.toLowerCase()}.${field.name}` === cKey ||
|
||||
`${field.table.toLowerCase()}.${field.alias}` === cKey)[0];
|
||||
},
|
||||
isNull (value) {
|
||||
return value === null ? ' is-null' : '';
|
||||
|
|
Loading…
Reference in New Issue