TheDocumentation Index
Fetch the complete documentation index at: https://docs.fiquela.io/llms.txt
Use this file to discover all available pages before exploring further.
INTO clause writes query results to a file. You call it on the result of ->execute(), passing a target file query that describes the output format and path.
Fluent API
Pass aFileQuery object or a raw file query string to ->into(). The method returns a FileQuery with effective defaults applied, which you can use to read the written file back:
FQL syntax
PlaceINTO after the FROM clause (and any WHERE, ORDER BY, etc.):
INTO uses the same file query syntax as FROM:
Output format path semantics
The.query part of the file query has different meanings depending on the output format. When the query is omitted or set to *, each writer applies a sensible default:
| Format | .query meaning | Default (when omitted or *) | Example |
|---|---|---|---|
| CSV | Ignored | * | — |
| NDJSON | Ignored | * | — |
| JSON | Nested key path for the output array. * or omitted writes a flat array. | * (flat array) | .root.items |
| XML | ROOT.ROW — root element name and row element name | rows.row | .SHOP.ITEM |
| XLSX / ODS | SheetName.StartCell — sheet name and top-left cell. * uses the first sheet starting at A1. | First sheet from A1 | .Sheet1.B4 |
Examples
Export to CSV
Export to JSON
Export to XML
Export to XLSX
Format-specific behavior
XLSX and ODS
Exported spreadsheets write the first row as bold column headers automatically. The header row contains the field names from your query.JSON
When the query path is* or omitted, JSON output writes a flat array at the root level. Specifying a dotted path (e.g. .root.items) nests the array under the corresponding keys.
Writer defaults
When you callinto(), the writer for the target format applies a default query path if none is specified. The into() method returns a FileQuery object that includes the effective query, so you can use it to read back the written file without guessing the path:
Writer, your class must provide a getFileQuery(): FileQuery method that returns the FileQuery with any default query applied.
File handling behavior
If the target file already exists, FiQueLa throws a
FileAlreadyExistsException and does not overwrite it. To export again, delete or rename the existing file first.