mirror of https://github.com/Fabio286/antares.git
fix: error joining tables with different schema
This commit is contained in:
parent
d52b7af297
commit
88408da745
|
@ -78,6 +78,7 @@ export const BLOB = [
|
|||
'TINYBLOB',
|
||||
'MEDIUMBLOB',
|
||||
'LONGBLOB',
|
||||
'LONG_BLOB',
|
||||
'BYTEA'
|
||||
];
|
||||
|
||||
|
|
|
@ -469,7 +469,12 @@ export class MySQLClient extends AntaresCore {
|
|||
.orderBy({ ORDINAL_POSITION: 'ASC' })
|
||||
.run<TableColumnsResult>();
|
||||
|
||||
const { rows: fields } = await this.raw<antares.QueryResult<CreateTableResult>>(`SHOW CREATE TABLE \`${schema}\`.\`${table}\``);
|
||||
let fields: CreateTableResult[] = [];
|
||||
try {
|
||||
const { rows } = await this.raw<antares.QueryResult<CreateTableResult>>(`SHOW CREATE TABLE \`${schema}\`.\`${table}\``);
|
||||
fields = rows;
|
||||
}
|
||||
catch (_) {}
|
||||
|
||||
const remappedFields = fields.map(row => {
|
||||
if (!row['Create Table']) return false;
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
"mediumblob": $blob-color,
|
||||
"medium_blob": $blob-color,
|
||||
"longblob": $blob-color,
|
||||
"long_blob": $blob-color,
|
||||
"bytea": $blob-color,
|
||||
"enum": $enum-color,
|
||||
"set": $enum-color,
|
||||
|
|
Loading…
Reference in New Issue