DOCUMENTATION

Commonwealth Console

Welcome to the Commonwealth SQL Console! Input SQL queries on your own tables or on public tables and get back results! Here's an example to try:

select * from example.foo

The console uses Commonwealth SQL dialect, which is mostly the same as Cloud Spanner SQL. Commonwealth supports select, insert, update, delete, and create table queries, among others.

When you execute a console query it's parsed client-side, and any syntax or type errors will be highlighted. Try running a syntactically invalid query like select * from to demonstrate.

Documentation

This text is being shown in the documentation pane, which dynamically loads helpful content as you type in the console. Like Clippy.

You can show and hide the documentation pane with Ctrl+h. When the pane is open it will change based on the most recent query you've typed. You can also press the Pin button to ensure the content remains static.

Shortcut Keys

Ctrl+EnterSubmit the current SQL query.
Ctrl+hToggle the Documentation Pane's visibility.
Shift+TabTrigger autosuggest on the cursor's position in the SQL Editor.
Ctrl+tSearch for a table name in the schema search pane.
Ctrl+kParse and format the current SQL query.

Autosuggest

The console will automatically suggest completions and possible nex keywords, including the names of tables and columns. Autosuggest will pop up as you type, or you can press Shift+Tab to manually trigger autosuggest. When autosuggest is active you can press Esc to clear it away.

Schema

As you're querying tables with SQL you'll probably want to reference the schema of those tables. The console shows you schema when you add reference a table in a from or join clause. If you type select * from example.foo in the console, it will show you the example.foo table schema in the Schema Pane. You can also add a schema with the Add Table button.

History

If you successfully execute a query it will be saved to your history, along with the query results, below the console input. You can click the old query to copy the query into the current console buffer, where you can re-run it.