SAP CAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 

The cds REPL is a powerful facility that helps us explore and debug. It's based on the regular Node.js REPL, which has a number of REPL-level commands:

; node
Welcome to Node.js v24.15.0.
Type ".help" for more information.
> .help
.break    Sometimes you get stuck, this gets you out
.clear    Alias for .break
.editor   Enter editor mode
.exit     Exit the REPL
.help     Print this help message
.load     Load JS from a file into the REPL session
.save     Save all evaluated commands in this REPL session to a file

Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL

The cds REPL extends the Node.js REPL with various commands, two of which have been available for a good while:

.inspect   Sets options for util.inspect, e.g. `.inspect .depth=1`.
.run       Runs a cds server from a given CAP project folder, or module name like @capire/bookshop.

Recently (in a CAP release earlier this year) the cds REPL gained a new "query mode" command, which enables us to write queries directly. In other words, instead of this:

> await cds.ql`SELECT from Books {title, price}`

we can, within the new query mode, write simply:

cql> select from Books {title, price}

What is the cds REPL command to enter this new query mode?

This is a question from the June Developer Challenge on CAP Knowledge. And don't forget: always submit your answer as a hash, on its own - read the Taking part section of the intro post for more info. At the end of today, this question will be updated with links to further reading on this topic.

Further info:

35 Comments
mvaibhav
Contributor

872f1383f2f4f71a09be2bcbacc0636f4060c3eb0e0980e080c87aaa86206ac7

furkan5
Participant

42eb9a8e76e2428ad93e13813b082698eef3ecf4f115af5943e850687ce2c00e

af39e8f596cbbf0babf1b3e304d0f6825aa0d45cad48f225d1072066f5d4494d

Dan_Wroblewski
Developer Advocate
Developer Advocate

9864311488a523c51041afc28a273accf39549db7ca09856f564f8a1b310191e

SachinArtani
Active Participant

b24eedc5cc5126ccc8e1c4998abc0f5ae4085833f218e42c0f460af3a0aefbcd

kasch-code
Participant

19f3d4bbd90f4099eb86892a231347fd13e76db1bf58504c52c4c89dd7ecfb0a

soheil_st
Explorer

5e6c20e71cee111a489c3f15a45423af3232fd78412faae25a53384034d4e119

ajmaradiaga
Developer Advocate
Developer Advocate

60a5565acd5ee0a0ffd436dbc8da4a1fd693f56f8494dc6fb2c00ae69f6c5efc

berkaydurmaz
Explorer

a1cebea6e1ec9b27add1d6ee25ca74c06a719cd2094282439a19c7b969c2113c

sarvesh_agarwal
Explorer

d1a47f7e98320405aada4719d92841adef58bc1bc45c36b53f03f83b22ffedd7

shotokka
Explorer

249030ba0403a62c6070a29d109434e902334f63e861c5d1c8ca817900b707c3

SergioG_TX
SAP Champion
SAP Champion

a30a236daa01304ddb4577f0e7a871bbc8813097d23b7e85c91e81c5bacaf9c0

yashwanth1711
Discoverer

5bc4a9f8869f4d34d7d3db4f6d3f84f

parthasaradhi
Explorer

faa5bb45e1a13da1332710fd30116534f6156c3c9b46e0734b86fe52b57f4292

Raphael
Explorer

e8b71b02d86a6c4a00ddb3badf567157757df0ecb30ba6cfafcf39014ef8eb50

Rupesh_Kumar25
Explorer

b4c6e8923c4aa9f8d91a822007be533ebe2ba57d6a21a9cef814bebfb3645dab

Joery
Participant

87ea82ec44163e8237525319d4f91f401f4abd12a8a96572313a23aa1256e2ca

MioYasutake
SAP Champion
SAP Champion

8154df3779813fe3e3df1ccad2f883593e093f179d56dd00bc2ade5b60ba4c00

Caisi
Explorer

ea98985f89dedf6127e04cdca3ab4099a5cef7e0d9fc0e55551f2758e0fc24ac

NakulG
Explorer

a5f139e8ad2eab846732af733000409162674bf2a6da675d861c0278dcc5ed0d

VishnAndr
Active Contributor

44a7d3ac17320d7898cf208b8503f7b84d86ca6f9697bf40f8bcfa82f4b4b929

GauravPhadnis
Product and Topic Expert
Product and Topic Expert

e963060841127485e0493dd70224cb1d27efb0321239e654a11114695add9f89

lidavidlee
Explorer

4f52c0323260be45cd1a3684c557820ac0fa33aadcea13df119911b2b7cfcaf6

RajeshOlive
Explorer

8388b9132d1d439214ba4a863a7b9bde7f76e0a105add016f5b26024ec16d92b

aelghannam
Participant

bb323fac7361d2b452c43b80cdaac7d5eaf269cf841eb1f0e770e82de14dc161

MatLakaemper
Participant

d522fdfb4eec1b256bf33370fac78fd24da95a2a7ab11c98077899bc28074717

Swathi_SAP_Philomath
Participant

85f226cbdbc5589435221e6958d08c65cb3c383fc10b8a994f8bfe44b4b430f5

Chaimae_Chairi27
Participant

552b88273f6c4027b1b452ab7bc8174483e109487a0e239ba0fbd7f2f1d3ec12

nagarjundas_1994
Explorer

0f54729ffbb982a370fac563a4de0f612b3614851f971c824e14de752dc7ad45

YLN
Explorer

3967f47eb37e8ae0801e48733a835e7a3434a3ca68294d827ea53a2edfbe56a6

Laco
Participant

bd4e276576388e420d639756c083c2e53ca8694bbd77e6866097dbda6da1e333

Anusha2025
Explorer
5b39e4d3362dedd4431a39da5ae13ea31d91e14a05900f583bfcd5770fdaa4f5
AndriiDanilishin
Participant

79cc3178d344babe4111f14831d4d1729228477858956dde862420d8647703c2

stickman_0x00
Participant

521492ca7ed3a1c892064870b68d36d5cfb95d4294b342cbab7b67af1ea3622c

gouthamKumar
Explorer

6100ebb8516a62c32ef915066108124fcfc3c93c6a7f13d8d3eb06f88ef89e5f