mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
merge dbgate master and test drivers
This commit is contained in:
parent
5c0c145fd6
commit
a0cefbc1ca
@ -108,7 +108,7 @@ const drivers = driverBases.map(driverBase => ({
|
||||
};
|
||||
}
|
||||
try {
|
||||
//console.log('sql', sql);
|
||||
console.log('sql', sql);
|
||||
const res = await client.execute(sql);
|
||||
//console.log('res', res);
|
||||
const columns = extractOracleColumns(res.metaData);
|
||||
@ -239,7 +239,7 @@ finally {
|
||||
rowMode: 'array',
|
||||
});
|
||||
*/
|
||||
//console.log('readQuery', sql, structure);
|
||||
console.log('readQuery', sql, structure);
|
||||
const query = await client.queryStream(sql);
|
||||
|
||||
let wasHeader = false;
|
||||
@ -250,29 +250,28 @@ finally {
|
||||
highWaterMark: 100,
|
||||
});
|
||||
|
||||
query.on('data', row => {
|
||||
query.on('metadata', row => {
|
||||
console.log('readQuery metadata', row);
|
||||
if (!wasHeader) {
|
||||
columns = extractOracleColumns(query._result);
|
||||
columns = extractOracleColumns(row);
|
||||
if (columns && columns.length > 0) {
|
||||
pass.write({
|
||||
__isStreamHeader: true,
|
||||
...(structure || { columns }),
|
||||
});
|
||||
}
|
||||
wasHeader = true;
|
||||
}
|
||||
|
||||
pass.write(zipDataRow(row, columns));
|
||||
});
|
||||
|
||||
query.on('end', () => {
|
||||
if (!wasHeader) {
|
||||
columns = extractOracleColumns(query._result);
|
||||
pass.write({
|
||||
__isStreamHeader: true,
|
||||
...(structure || { columns }),
|
||||
});
|
||||
wasHeader = true;
|
||||
}
|
||||
query.on('data', row => {
|
||||
console.log('readQuery data', row);
|
||||
pass.write(zipDataRow(row, columns));
|
||||
});
|
||||
|
||||
query.on('end', () => {
|
||||
pass.end();
|
||||
});
|
||||
|
||||
|
@ -8,6 +8,7 @@ const spatialTypes = ['GEOGRAPHY'];
|
||||
const dialect = {
|
||||
rangeSelect: false,
|
||||
limitSelect: false,
|
||||
offsetFetchRangeSyntax: true,
|
||||
ilike: true,
|
||||
// stringEscapeChar: '\\',
|
||||
stringEscapeChar: "'",
|
||||
|
Loading…
Reference in New Issue
Block a user