Skip to content

Commit 2526c57

Browse files
committed
update
1 parent 4b6cb93 commit 2526c57

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Diff for: packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,12 @@ describe('SQL Generation', () => {
293293
294294
cube('visitor_checkins', {
295295
sql: \`
296-
select * from visitor_checkins WHERE
297-
\${FILTER_PARAMS.visitor_checkins.created_at.filter('created_at')} AND
298-
\${FILTER_GROUP(FILTER_PARAMS.visitor_checkins.created_at.filter("(created_at - INTERVAL '3 DAY')"), FILTER_PARAMS.visitor_checkins.source.filter('source'))}
296+
select visitor_checkins.* from visitor_checkins left join visitors on visitor_checkins.visitor_id = visitors.id WHERE
297+
\${FILTER_PARAMS.visitor_checkins.created_at.filter('visitor_checkins.created_at')} AND
298+
\${FILTER_GROUP(FILTER_PARAMS.visitor_checkins.created_at.filter("(visitor_checkins.created_at - INTERVAL '3 DAY')"), FILTER_PARAMS.visitor_checkins.source.filter('visitor_checkins.source'))}
299+
AND \${SECURITY_CONTEXT.source.filter('visitors.source')} AND
300+
\${SECURITY_CONTEXT.sourceArray.filter(sourceArray => \`visitors.source in (\${sourceArray.join(',')})\`)}
301+
299302
\`,
300303
sql_alias: \`vc\`,
301304
@@ -1072,7 +1075,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
10721075
});
10731076
});
10741077

1075-
it('filter join 1', async () => {
1078+
it('filter join', async () => {
10761079
await compiler.compile();
10771080

10781081
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
@@ -1692,7 +1695,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
16921695
});
16931696
});
16941697

1695-
it('security context 1', async () => {
1698+
it('security context', async () => {
16961699
await compiler.compile();
16971700

16981701
const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
@@ -1868,7 +1871,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
18681871
]));
18691872

18701873
it(
1871-
'contains filter 1',
1874+
'contains filter',
18721875
() => runQueryTest({
18731876
measures: [],
18741877
dimensions: [
@@ -2663,7 +2666,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
26632666
]
26642667
));
26652668

2666-
it('rank measure 1', async () => runQueryTest(
2669+
it('rank measure', async () => runQueryTest(
26672670
{
26682671
measures: ['visitors.revenue_rank'],
26692672
},

0 commit comments

Comments
 (0)