use FQL\Enum\Format;
use FQL\Stream;
// Auto-detect from extension
$csv = Stream\Provider::fromFile('products.csv');
// Explicit format
$csv = Stream\Provider::fromFile('data.txt', Format::CSV);
// Direct class
$csv = Stream\Csv::open('products.csv');
// With custom delimiter
$csv = Stream\Csv::openWithDelimiter('products.csv', ';');
$query = $csv->query()->selectAll()->from('*');
CSV supports two format-specific parameters: encoding (default utf-8) and delimiter (default ,). Pass them via the FQL string syntax: csv(data.csv, "windows-1250", ";").
use FQL\Enum\Format;
use FQL\Stream;
// Auto-detect from extension
$xml = Stream\Provider::fromFile('feed.xml');
// Explicit format
$xml = Stream\Provider::fromFile('data', Format::XML);
// Direct class
$xml = Stream\Xml::open('feed.xml');
// With explicit encoding
$xml = Stream\Xml::openWithEncoding('feed.xml', 'windows-1250');
$query = $xml->query()->selectAll()->from('SHOP.SHOPITEM');
XML supports the encoding parameter (default utf-8). Specify it in FQL syntax: xml(feed.xml, "windows-1250").
use FQL\Enum\Format;
use FQL\Stream;
// Auto-detect: .json and .jsonfile extensions map to JsonStream
$json = Stream\Provider::fromFile('large-dataset.json');
// Explicit format key
$json = Stream\Provider::fromFile('data', Format::JSON_STREAM);
// Direct class
$json = Stream\JsonStream::open('large-dataset.json');
$query = $json->query()->selectAll()->from('data.items');
JsonStream uses halaxa/json-machine for streaming, making it suitable for large JSON files where loading the entire document into memory would be impractical.