1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00

fix column order in result set #74

This commit is contained in:
lana-k
2021-08-10 20:31:12 +02:00
parent 2ed5160f65
commit 9f32323a80
13 changed files with 155 additions and 92 deletions

View File

@@ -19,9 +19,12 @@ describe('csv.js', () => {
}
}
expect(csv.getResult(source)).to.eql({
id: [1, 2],
name: ['foo', 'bar'],
date: ['2021-06-30T14:10:24.717Z', '2021-07-30T14:10:15.717Z']
columns: ['id', 'name', 'date'],
values: {
id: [1, 2],
name: ['foo', 'bar'],
date: ['2021-06-30T14:10:24.717Z', '2021-07-30T14:10:15.717Z']
}
})
})
@@ -34,9 +37,12 @@ describe('csv.js', () => {
meta: {}
}
expect(csv.getResult(source)).to.eql({
col1: [1, 2],
col2: ['foo', 'bar'],
col3: ['2021-06-30T14:10:24.717Z', '2021-07-30T14:10:15.717Z']
columns: ['col1', 'col2', 'col3'],
values: {
col1: [1, 2],
col2: ['foo', 'bar'],
col3: ['2021-06-30T14:10:24.717Z', '2021-07-30T14:10:15.717Z']
}
})
})
@@ -73,8 +79,11 @@ describe('csv.js', () => {
const result = await csv.parse(file)
expect(result).to.eql({
data: {
col1: [1, 2],
col2: ['foo', 'bar']
columns: ['col1', 'col2'],
values: {
col1: [1, 2],
col2: ['foo', 'bar']
}
},
delimiter: ',',
rowCount: 2,