DEV Community

Jawad Ali Abbasi
Jawad Ali Abbasi

Posted on

AGESQL | CLI Tool For AGE (Demo)

Welcome Back Guys!

In the last blog we learned how to install and setup age cli on our systems. Now we will see how to run and query it to perform different operations.

Let's get on with it.

So first of all make sure postgresql server is running and create a database in it if one doesn't already exist.

Now, open terminal from age directory inside AGE_CLI folder and run the following command:

./agesql demo

This command will start the AGESQL. "demo" here specifies the database name which will be used to send queries. You have to replace this demo db name with your own database name.

After running the command, the next lines will change a bit, prompting you to enter queries to run.

Now to run cypher queries, first we have to type the backslash character "\" and hit the Return key so that CLI can enter the mode to understand cypher queries.

Next, we have to write queries and get results.
( Remember to end queries with a semicolon ";" )

The following screenshot of terminal shows an example of a sample query.

Image description

So that's how you can use AGE CLI Tool to write cypher queries to the database. Will come back with more interesting stuff. Stay Tuned...


Top comments (0)