Skip to main content

Importing Data

Kvery can feed the rows of an uploaded file into a query, letting you insert or update many records from a spreadsheet or data export without writing a script.

How importing works​

You pair an import file with a query that knows how to handle a single row. Kvery reads the file and runs the query for each row, passing the row's values in as parameters. This is built on the same form variables mechanism — the columns in your file map to the variables in the query.

A typical import query is a write query, for example:

INSERT INTO contacts (name, email, country)
VALUES ('$name', '$email', '$country');

Each row of the uploaded file supplies $name, $email, and $country.

Row-by-row processing​

Imports are processed row by row so that each record is handled predictably and errors can be reported against the specific row that failed. If a row fails, the log and the response indicate which row caused the problem, so you can correct your file and re-run.

Import batch size​

Each query has an import batch size that controls how many files an import run accepts. It defaults to 1, but you can change it on the query's import settings — so this is a configurable default, not a fixed platform limit. See Plans and limits.

Tips for reliable imports​

  • Make sure your file's columns line up with the query's form variables.
  • Use a draft to test the import query on a small file first.
  • Validate or clean the data in your file before importing — Kvery runs exactly the SQL you wrote against each row.
  • Watch the logs during a large import to catch failures early.