mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
feat: implement a better query splitter for SQL queries, fixes #926
This commit is contained in:
@ -245,10 +245,10 @@ export class FirebirdSQLClient extends BaseClient {
|
||||
name: db.name,
|
||||
size: schemaSize,
|
||||
tables: remappedTables,
|
||||
functions: [],
|
||||
functions: [] as null[],
|
||||
procedures: remappedProcedures,
|
||||
triggers: remappedTriggers,
|
||||
schedulers: []
|
||||
schedulers: [] as null[]
|
||||
};
|
||||
});
|
||||
}
|
||||
@ -337,7 +337,7 @@ export class FirebirdSQLClient extends BaseClient {
|
||||
|
||||
return {
|
||||
name: field.FIELD_NAME.trim(),
|
||||
key: null,
|
||||
key: null as null,
|
||||
type: fieldType,
|
||||
schema: schema,
|
||||
table: table,
|
||||
@ -346,14 +346,14 @@ export class FirebirdSQLClient extends BaseClient {
|
||||
datePrecision: field.FIELD_NAME.trim() === 'TIMESTAMP' ? 4 : null,
|
||||
charLength: ![...NUMBER, ...FLOAT].includes(fieldType) ? field.FIELD_LENGTH : null,
|
||||
nullable: !field.NOT_NULL,
|
||||
unsigned: null,
|
||||
zerofill: null,
|
||||
unsigned: null as null,
|
||||
zerofill: null as null,
|
||||
order: field.FIELD_POSITION+1,
|
||||
default: defaultValue,
|
||||
charset: field.CHARSET,
|
||||
collation: null,
|
||||
collation: null as null,
|
||||
autoIncrement: false,
|
||||
onUpdate: null,
|
||||
onUpdate: null as null,
|
||||
comment: field.DESCRIPTION?.trim()
|
||||
};
|
||||
});
|
||||
@ -457,7 +457,7 @@ export class FirebirdSQLClient extends BaseClient {
|
||||
table: table,
|
||||
field: field.FKCOLUMN_NAME.trim(),
|
||||
position: field.KEY_SEQ,
|
||||
constraintPosition: null,
|
||||
constraintPosition: null as null,
|
||||
constraintName: field.FK_NAME.trim(),
|
||||
refSchema: schema,
|
||||
refTable: field.PKTABLE_NAME.trim(),
|
||||
@ -1041,9 +1041,7 @@ export class FirebirdSQLClient extends BaseClient {
|
||||
const resultsArr = [];
|
||||
let paramsArr = [];
|
||||
const queries = args.split
|
||||
? sql.split(/((?:[^;'"]*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*')[^;'"]*)+)|;/gm)
|
||||
.filter(Boolean)
|
||||
.map(q => q.trim())
|
||||
? this._querySplitter(sql, 'firebird')
|
||||
: [sql];
|
||||
|
||||
let connection: firebird.Database | firebird.Transaction;
|
||||
|
Reference in New Issue
Block a user