AgriQL · Documentation · Getting started
Getting started
Install AgriQL first. Then create a database for a farm or a trial and run one query. Each agriql query starts fresh, so name the database in the statement.
1. Prepare the directories
agriql init agriql doctor
init creates the configuration and data directories for your user. doctor prints whether the installation can see them.
2. Create a database
agriql database create farm agriql database list
This writes farm.aqdb in the data directory.
3. Add a schema and a table
agriql query "USE DATABASE farm; CREATE SCHEMA agriculture;"
4. Import, summarise, export
Put the CSV in the data directory. The import creates agriculture.soil from that file, and it records the file the rows came from. A path that leaves the data directory is refused.
agriql query "USE DATABASE farm; IMPORT CSV 'soil.csv' INTO agriculture.soil;" agriql query "USE DATABASE farm; SELECT plant_id, AVG(soil_moisture) FROM agriculture.soil WHERE soil_moisture < 25 GROUP BY plant_id;" agriql query "USE DATABASE farm; EXPORT XLSX agriculture.soil TO 'soil.xlsx';"
5. Check the table
agriql query "USE DATABASE farm; PROFILE agriculture.soil;"
The profile reports empty values and unusual numbers. A summary reads one table. It does not join two tables.
Where the files are
- Windows data:
%LOCALAPPDATA%\AgriQL - macOS data:
~/Library/Application Support/AgriQL - Linux data:
~/.local/share/agriql
Set AGRIQL_HOME if you want configuration and data under one directory of your choosing. Removing the program does not delete these files.