Query tools: corasql and drivers
corasql
Section titled “corasql”corasql is the command-line SQL interpreter installed with CoraDB. It runs SQL and graph queries interactively or from files, and offers session commands for schemas, plans, traces and parameters. The corasql interpreter page describes all its options and commands.
Start it with a user and a database name. The users DBA and PUBLIC exist in every database and have no password until one is set:
corasql -u dba e-commerceType a statement ending with a semicolon to run it, and ;help to list the session commands:
SELECT c.company_name, COUNT(*) AS ordersFROM orders o JOIN customer c ON c.id = o.customer_idGROUP BY c.company_name ORDER BY 2 DESC, 1 LIMIT 3;| company_name | orders |
|---|---|
| Kelly Ltd | 49 |
| Mayer, Carroll and Owens | 40 |
| Young and Sons | 40 |
Statements can also be run without the interactive prompt, from the command line (-c) or from a file (-i), with output formats for scripts (-t, -q, -d):
corasql -u dba -c "SELECT COUNT(*) FROM orders" e-commercecorasql -u dba -i monthly_report.sql -o monthly_report.txt e-commerceLeave corasql with ;exit.
Drivers
Section titled “Drivers”Applications connect through the CoraDB broker with one of the drivers:
| Language | Driver |
|---|---|
| Java | JDBC |
| JavaScript / TypeScript | Node.js |
| PHP | PHP |
| C# / .NET | ADO.NET |
| Python | Python |
| C / C++ | CCI |