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