@malloydata/malloy-tests 0.0.185-dev240919162259 → 0.0.185-dev240919164016
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@jest/globals": "^29.4.3",
|
|
24
|
-
"@malloydata/db-bigquery": "^0.0.185-
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.185-
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.185-
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.185-
|
|
28
|
-
"@malloydata/db-trino": "^0.0.185-
|
|
29
|
-
"@malloydata/malloy": "^0.0.185-
|
|
30
|
-
"@malloydata/render": "^0.0.185-
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.185-dev240919164016",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.185-dev240919164016",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.185-dev240919164016",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.185-dev240919164016",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.185-dev240919164016",
|
|
29
|
+
"@malloydata/malloy": "^0.0.185-dev240919164016",
|
|
30
|
+
"@malloydata/render": "^0.0.185-dev240919164016",
|
|
31
31
|
"jsdom": "^22.1.0",
|
|
32
32
|
"luxon": "^2.4.0",
|
|
33
33
|
"madge": "^6.0.0"
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"@types/jsdom": "^21.1.1",
|
|
37
37
|
"@types/luxon": "^2.4.0"
|
|
38
38
|
},
|
|
39
|
-
"version": "0.0.185-
|
|
39
|
+
"version": "0.0.185-dev240919164016"
|
|
40
40
|
}
|
|
@@ -43,8 +43,7 @@ class StringAccumulator implements WriteStream {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const [describe, databases] = describeIfDatabaseAvailable([
|
|
46
|
-
|
|
47
|
-
// 'bigquery',
|
|
46
|
+
'bigquery',
|
|
48
47
|
'postgres',
|
|
49
48
|
'duckdb',
|
|
50
49
|
'duckdb_wasm',
|
|
@@ -66,14 +65,14 @@ describe('Streaming tests', () => {
|
|
|
66
65
|
.loadModel(
|
|
67
66
|
`source: airports is ${databaseName}.table('malloytest.airports')`
|
|
68
67
|
)
|
|
69
|
-
.loadQuery('run: airports -> { select: code }')
|
|
68
|
+
.loadQuery('run: airports -> { select: code; order_by: code }')
|
|
70
69
|
.runStream({rowLimit: 10});
|
|
71
70
|
const rows: DataRecord[] = [];
|
|
72
71
|
for await (const row of stream) {
|
|
73
72
|
rows.push(row);
|
|
74
73
|
}
|
|
75
74
|
expect(rows.length).toBe(10);
|
|
76
|
-
expect(rows[0].cell('code').string.value).toBe('
|
|
75
|
+
expect(rows[0].cell('code').string.value).toBe('00A');
|
|
77
76
|
});
|
|
78
77
|
|
|
79
78
|
it(`stream to JSON - ${databaseName}`, async () => {
|
|
@@ -81,7 +80,7 @@ describe('Streaming tests', () => {
|
|
|
81
80
|
.loadModel(
|
|
82
81
|
`source: airports is ${databaseName}.table('malloytest.airports')`
|
|
83
82
|
)
|
|
84
|
-
.loadQuery('run: airports -> { select: code }')
|
|
83
|
+
.loadQuery('run: airports -> { select: code; order_by: code }')
|
|
85
84
|
.runStream({rowLimit: 1});
|
|
86
85
|
const accummulator = new StringAccumulator();
|
|
87
86
|
const jsonWriter = new JSONWriter(accummulator);
|
|
@@ -89,7 +88,7 @@ describe('Streaming tests', () => {
|
|
|
89
88
|
expect(accummulator.accumulatedValue).toBe(
|
|
90
89
|
`[
|
|
91
90
|
{
|
|
92
|
-
"code": "
|
|
91
|
+
"code": "00A"
|
|
93
92
|
}
|
|
94
93
|
]
|
|
95
94
|
`
|
|
@@ -101,12 +100,12 @@ describe('Streaming tests', () => {
|
|
|
101
100
|
.loadModel(
|
|
102
101
|
`source: airports is ${databaseName}.table('malloytest.airports')`
|
|
103
102
|
)
|
|
104
|
-
.loadQuery('run: airports -> { select: code }')
|
|
103
|
+
.loadQuery('run: airports -> { select: code; order_by: code }')
|
|
105
104
|
.runStream({rowLimit: 1});
|
|
106
105
|
const accummulator = new StringAccumulator();
|
|
107
106
|
const csvWriter = new CSVWriter(accummulator);
|
|
108
107
|
await csvWriter.process(stream);
|
|
109
|
-
expect(accummulator.accumulatedValue).toBe('code\
|
|
108
|
+
expect(accummulator.accumulatedValue).toBe('code\n00A\n');
|
|
110
109
|
});
|
|
111
110
|
});
|
|
112
111
|
});
|