AgriQL · Documentation · Why it is important

Why AgriQL is important

A farm record is a set of measurements, not a set of bare numbers. Rain, soil moisture, fertiliser, irrigation, and a crop note can sit in the same table and look interchangeable. They are not. AgriQL exists so that mistake is caught in the record, and so a season does not fall apart across files that no longer agree.

The same numeral is not the same quantity

Twenty-five millimetres of rain, twenty-five percent moisture, and twenty-five kilograms of fertiliser are three different statements. A spreadsheet will add them. A general-purpose database will store them as numbers and add them if a later query asks. The person who made the table may have known the difference. The person who opens it next year may not.

AgriQL keeps the unit with the value. It rejects a length added to a mass. It accepts millimetres added to metres, because both are length. The check is not a note in a cell. It is part of using the file.

A season should be one file

Soil, crop, water, and weather for one farm or one field trial belong together. AgriQL keeps them in a single .aqdb file. That file can be copied, handed to someone else, and opened again. There is not a folder of versions whose names say “final” and “final-2”.

Removing the program does not delete the file. The record outlives the particular machine it was written on.

You can see where the rows came from

An import from CSV, TSV, JSON, or Excel records the source file. A later reader can see that the rows were brought in, not typed as if they had no origin. That matters when a moisture reading is questioned: the table and the file it came from are still connected.

Trust the figure before you act on it

An average hides empty rows and odd values. AgriQL can profile a table and report those. It can also count gaps along a time column, which is the difference between a sensor that reported all season and one that went quiet for a week. A gap is not a reading of zero. Treating it as one changes the average.

A summary in this release reads one table. It can count, and it can take a minimum, a maximum, an average, and a standard deviation, with a filter and a grouping. It does not join several tables. That limit is stated because a joined figure that the software cannot produce should not be assumed.

The tools you already use stay outside the record

Excel, Python, and R are how many people study a season. AgriQL can write a table back out to CSV, TSV, JSON, or Excel, and the Python, R, and Arrow clients can take rows. They are not a second copy of the database. If the notebook is lost, the .aqdb file is still the record. The analysis tool is allowed to change. The archive should not have to.

The record starts in the field

The first copy of a soil reading is made by a small battery-powered chip in the field. It often has no network for hours, and its power can be cut at any moment. If the reading is lost there, nothing later can bring it back.

A field-device logger is in development after 3.10.1, and it is not in that release. It writes readings straight into the chip's own flash memory, without a file system. It is built to survive a power cut in the middle of a write. The server reads the same format the device wrote, so a reading is not reshaped on its way in. On emulated Cortex-M3, Cortex-M4, and RISC-V boards, recording one soil reading takes about 1,500 instructions and under 6 bytes of flash. See the measurements and what they leave out.

A timestamp should say how sure it is

A field device's clock drifts. An ordinary crystal can gain or lose several seconds a day, and network time is not exact either. A reading stamped with the device's guess of the time looks exact, and it is not.

The development logger keeps the device's own time and records each clock check with where it came from, such as satellite positioning, the network, or a person in the field. The real time of each reading is worked out afterwards, together with an error bound. A reading two hours from the last clock check honestly carries a wider error than one taken a minute after it.

Flag a doubtful reading, do not erase it

A stuck probe, a spike, a value outside what soil can hold, or a reading taken in frozen soil should not drive an irrigation decision. It should not disappear from the record either. In the development build, automatic checks run when readings are read, and each failed check sets a flag. The reading itself stays as it was recorded. When a threshold is changed later, the whole history is checked again, and nothing that was stored is rewritten.

Where it is the wrong tool

AgriQL is not important for a shop, an invoice ledger, or a general website. It does not read Parquet, and it does not read a spreadsheet that exists only online. Use it when the thing you need to trust is an agricultural measurement, and when mixing those measurements up would matter.

How this differs from a spreadsheet and from a general-purpose database.