Install the EdgeSQL Shell
Clone the EdgeSQL Shell from its repository, install its dependencies in a virtual environment, and authenticate it with your personal token.
EdgeSQL Shell is a Python command-line tool that manages SQL Database databases, runs SQL against them, and imports data into them. It is not published on a package index: you clone the repository and install it from source. The shell authenticates with your personal token, read from the AZION_TOKEN environment variable.
For the commands the shell accepts once it is installed, refer to EdgeSQL Shell.
Prerequisites
- Python 3, with the
venvmodule it ships with. - The Postgres headers.
requirements.txtpinspsycopg2, which builds from source and fails to compile without them. On macOS, install them withbrew install postgresql. - A personal token. The shell reads it from
AZION_TOKEN. - SQL Database enabled on your account. The product is in Preview and is not enabled by default, so request access through Technical Support.
Install the shell
The install clones the repository, isolates the dependencies in a virtual environment, and puts the token in the environment the shell reads. To install the shell:
Git writes the tool into an edgesql-shell directory under the current one.
The env directory holds the environment, and it stays active for the rest of the terminal session.
The packages land in env rather than in the system Python. psycopg2 compiles here, against the Postgres headers from the prerequisites.
Replace [TOKEN VALUE] with your personal token. The variable holds for the current terminal session.
On a clean install, the startup ends in the import failure instead of the prompt:
The tool is installed in edgesql-shell, with its dependencies in the env environment and your token in AZION_TOKEN. The shell opens on the EdgeSQL> prompt, where each line you enter is a shell command or a SQL statement against the database in use.
Until the defect above is fixed, the last step ends on the ImportError rather than on the prompt. The installation itself is complete: the repository, the environment, the dependencies, and the token are all in place, and the shell starts once the Kaggle import is repaired upstream.
Run a command without the interactive prompt
Two flags run the shell without the prompt. -n makes the run non-interactive, and -c passes one command. Repeat -c to run several commands in order:
The run selects the MyDB database, lists its tables, and exits. It reaches the ImportError too until the fix ships, because the shell loads the same modules whichever way it starts.