mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 05:16:00 +00:00
fixed oracle export + clickhouse test
This commit is contained in:
@@ -26,9 +26,9 @@ function createImportStream() {
|
||||
|
||||
function createExportStream() {
|
||||
const writable = new stream.Writable({ objectMode: true });
|
||||
writable.result = [];
|
||||
writable.resultArray = [];
|
||||
writable._write = (chunk, encoding, callback) => {
|
||||
writable.result.push(chunk);
|
||||
writable.resultArray.push(chunk);
|
||||
callback();
|
||||
};
|
||||
return writable;
|
||||
@@ -116,7 +116,7 @@ describe('DB Import/export', () => {
|
||||
testWrapper(async (conn, driver, engine) => {
|
||||
// const reader = await fakeObjectReader({ delay: 10 });
|
||||
// const reader = await fakeObjectReader();
|
||||
await runCommandOnDriver(conn, driver, 'create table ~t1 (~id int, ~country varchar(100))');
|
||||
await runCommandOnDriver(conn, driver, 'create table ~t1 (~id int primary key, ~country varchar(100))');
|
||||
const data = [
|
||||
[1, 'Czechia'],
|
||||
[2, 'Austria'],
|
||||
@@ -138,7 +138,7 @@ describe('DB Import/export', () => {
|
||||
const writer = createExportStream();
|
||||
await copyStream(reader, writer);
|
||||
|
||||
expect(writer.result.filter(x => !x.__isStreamHeader).map(row => [row.id, row.country])).toEqual(data);
|
||||
expect(writer.resultArray.filter(x => !x.__isStreamHeader).map(row => [row.id, row.country])).toEqual(data);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user