@malloydata/malloy 0.0.196-dev241007190115 → 0.0.196-dev241007221852
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.
|
@@ -355,6 +355,9 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
355
355
|
this.contextError(pcx, 'missing-on-in-join-many', 'join_many: requires ON expression');
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
+
else if (join instanceof ast.KeyJoin) {
|
|
359
|
+
this.contextError(pcx, 'foreign-key-in-join-many', 'Foreign key join not legal in join_many:');
|
|
360
|
+
}
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
363
|
const joinMany = new ast.JoinStatement(joins);
|
package/dist/lang/parse-log.d.ts
CHANGED
|
@@ -290,6 +290,7 @@ type MessageParameterTypes = {
|
|
|
290
290
|
'failed-to-parse-time-literal': string;
|
|
291
291
|
'table-function': string;
|
|
292
292
|
'missing-on-in-join-many': string;
|
|
293
|
+
'foreign-key-in-join-many': string;
|
|
293
294
|
'join-statement-in-view': string;
|
|
294
295
|
'unknown-matrix-operation': string;
|
|
295
296
|
'declare': string;
|
|
@@ -143,6 +143,9 @@ describe('source:', () => {
|
|
|
143
143
|
test('many on', () => {
|
|
144
144
|
expect('source: nab is a extend { join_many: b on astr = b.astr }').toTranslate();
|
|
145
145
|
});
|
|
146
|
+
test('many with', () => {
|
|
147
|
+
expect((0, test_translator_1.model) `source: nab is a extend { ${'join_many: b with astr'} }`).toLog((0, test_translator_1.errorMessage)('Foreign key join not legal in join_many:'));
|
|
148
|
+
});
|
|
146
149
|
test('many is on', () => {
|
|
147
150
|
expect('source: y is a extend { join_many: x is b on astr = x.astr }').toTranslate();
|
|
148
151
|
});
|
|
@@ -184,13 +187,6 @@ describe('source:', () => {
|
|
|
184
187
|
source: awith is a extend {
|
|
185
188
|
join_one: has_primary_key is a -> { group_by: one_val is astr } with astr
|
|
186
189
|
}
|
|
187
|
-
`).toTranslate();
|
|
188
|
-
});
|
|
189
|
-
test('join-many: with is ok', () => {
|
|
190
|
-
expect(`
|
|
191
|
-
source: awithmany is a extend {
|
|
192
|
-
join_many: manyb is a with astr
|
|
193
|
-
}
|
|
194
190
|
`).toTranslate();
|
|
195
191
|
});
|
|
196
192
|
});
|