Table of Contents

Class OutputRoutingOptions

Namespace
ItTiger.TigerQuery.Engine
Assembly
ItTiger.TigerQuery.dll
Configures TigerQuery's script-directed output routing, file output, and the built-in structured result-set writer.
public sealed class OutputRoutingOptions
Inheritance
OutputRoutingOptions
Inherited Members

Remarks

All routing is opt-in. With no initial path and no :Out or :Error directive, result sets and messages continue to reach OnResultSet and OnMessage and no file is created.

When a channel is routed to a file its presentation callback is not invoked. This is redirection, not mirroring. Structured logging through Logger is independent of routing and continues for every message.

Files are created lazily, on the first payload written to a physical destination, using create/truncate semantics on first use in a run. The parent directory must already exist; TigerQuery never creates directories. Output is never appended across runs.

Properties

AllowScriptOutputDirectives

Gets whether scripts may change output routes with :Out and :Error.
public bool AllowScriptOutputDirectives { get; init; }

Property Value

bool

Remarks

The default is true. A service or restricted host can set it to false, which makes an encountered directive a parser error rather than a silently ignored command.

BaseDirectory

Gets the directory that relative output paths are resolved against.
public string? BaseDirectory { get; init; }

Property Value

string

Remarks

The value is captured once at run start. When it is null, CurrentDirectory is captured instead. The same rule applies to every entry point, including RunFromFileAsync(string, Encoding?, CancellationToken); a host that wants paths relative to the script must pass the script directory explicitly.

FileEncoding

Gets the encoding used for every output file.
public Encoding? FileEncoding { get; init; }

Property Value

Encoding

Remarks

null selects TigerQuery's default of UTF-8 with a byte-order mark, which is the supported interoperability baseline.

A supplied encoding is validated at run start and used with exception fallbacks, so an unencodable character fails the run instead of being silently replaced. Its byte-order-mark preference is preserved. CSV-library and spreadsheet interoperability then depends on that encoding and on consumer support for it.

InitialErrorPath

Gets the initial error-message file, applied at run start before any script directive.
public string? InitialErrorPath { get; init; }

Property Value

string

Remarks

A relative path is resolved against BaseDirectory. A script :Error directive replaces this route from its position onward.

InitialOutPath

Gets the initial result-set file, applied at run start before any script directive.
public string? InitialOutPath { get; init; }

Property Value

string

Remarks

The value follows OutBehavior exactly as an :Out directive does, so it can also redirect normal messages to the companion file. A relative path is resolved against BaseDirectory. A script :Out directive replaces this route from its position onward.

OutBehavior

Gets which channels an :Out directive redirects.
public OutDirectiveBehavior OutBehavior { get; init; }

Property Value

OutDirectiveBehavior

ResultSetFileMode

Gets whether routed result sets share one file or get one file each.
public ResultSetFileMode ResultSetFileMode { get; init; }

Property Value

ResultSetFileMode

ResultSetFormat

Gets the built-in format used for routed result sets.
public ResultSetOutputFormat ResultSetFormat { get; init; }

Property Value

ResultSetOutputFormat