merge dbgate master and test drivers

This commit is contained in:
Rinie Kervel 2022-10-30 08:32:53 +01:00
parent 5c0c145fd6
commit a0cefbc1ca
2 changed files with 13 additions and 13 deletions

View File

@ -108,7 +108,7 @@ const drivers = driverBases.map(driverBase => ({
}; };
} }
try { try {
//console.log('sql', sql); console.log('sql', sql);
const res = await client.execute(sql); const res = await client.execute(sql);
//console.log('res', res); //console.log('res', res);
const columns = extractOracleColumns(res.metaData); const columns = extractOracleColumns(res.metaData);
@ -239,7 +239,7 @@ finally {
rowMode: 'array', rowMode: 'array',
}); });
*/ */
//console.log('readQuery', sql, structure); console.log('readQuery', sql, structure);
const query = await client.queryStream(sql); const query = await client.queryStream(sql);
let wasHeader = false; let wasHeader = false;
@ -250,29 +250,28 @@ finally {
highWaterMark: 100, highWaterMark: 100,
}); });
query.on('data', row => { query.on('metadata', row => {
console.log('readQuery metadata', row);
if (!wasHeader) { if (!wasHeader) {
columns = extractOracleColumns(query._result); columns = extractOracleColumns(row);
if (columns && columns.length > 0) {
pass.write({ pass.write({
__isStreamHeader: true, __isStreamHeader: true,
...(structure || { columns }), ...(structure || { columns }),
}); });
}
wasHeader = true; wasHeader = true;
} }
pass.write(zipDataRow(row, columns)); pass.write(zipDataRow(row, columns));
}); });
query.on('end', () => { query.on('data', row => {
if (!wasHeader) { console.log('readQuery data', row);
columns = extractOracleColumns(query._result); pass.write(zipDataRow(row, columns));
pass.write({
__isStreamHeader: true,
...(structure || { columns }),
}); });
wasHeader = true;
}
query.on('end', () => {
pass.end(); pass.end();
}); });

View File

@ -8,6 +8,7 @@ const spatialTypes = ['GEOGRAPHY'];
const dialect = { const dialect = {
rangeSelect: false, rangeSelect: false,
limitSelect: false, limitSelect: false,
offsetFetchRangeSyntax: true,
ilike: true, ilike: true,
// stringEscapeChar: '\\', // stringEscapeChar: '\\',
stringEscapeChar: "'", stringEscapeChar: "'",