Skip to content

Commit af7f5e0

Browse files
authored
show cqn when running cql queries (#2438)
The `CQN` is now also shown in addition to the result and the `SQL`. <img width="701" height="514" alt="Screenshot 2026-03-06 at 09 42 44" src="https://github.com/user-attachments/assets/d1242ffc-d72d-429f-a4af-b173ee9dd9dc" />
1 parent 2ff882d commit af7f5e0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • .vitepress/theme/components/cds-playground

.vitepress/theme/components/cds-playground/runners.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ async function evalJS(code) {
8181

8282
async function cdsQL(query) {
8383
const cds = await initialized;
84+
const cqn = cds.ql(query);
8485

85-
const { result, formatted } = await sql.trace(() => cds.ql(query));
86+
const { result, formatted } = await sql.trace(() => cds.db.run(cqn));
8687
return [
8788
{ value: result, kind: 'json', name: 'Result' },
88-
{ value: formatted, kind: 'sql', name: 'SQL'}
89+
{ value: formatted, kind: 'sql', name: 'SQL'},
90+
{ value: cqn, kind: 'json', name: 'CQN' },
8991
];
9092
}
9193

0 commit comments

Comments
 (0)