pub struct Options {
pub database: String,
pub commands: Vec<Command>,
pub stop_after_commands: bool,
pub interactive: Option<bool>,
pub echo: bool,
pub bail: bool,
pub readonly: bool,
pub sets: Vec<String>,
pub metrics: Option<PathBuf>,
pub settings: Settings,
}Expand description
Everything the command line can set.
Fields§
§database: StringThe database to open. :memory: until there is a storage format to open a file with.
commands: Vec<Command>What to run before reading input, in the order it was given.
stop_after_commands: boolWhether to stop after the commands rather than reading input.
interactive: Option<bool>Set by -interactive and -batch, which override the guess made from whether input is a
terminal.
echo: boolPrint each statement before running it.
bail: boolStop at the first error even when reading a script.
readonly: boolOpen without allowing writes.
sets: Vec<String>What --set name=value asked for, in the order it was given.
Kept apart from Options::commands rather than pushed in as SQL, because these run
before everything else whatever position they were written in. A flag that configures the
engine and a flag that runs a query are two different things, and a benchmark script that
puts its --set at the end of the line means the same thing as one that puts it first.
metrics: Option<PathBuf>Where --metrics writes what each statement reported about itself, one document per line.
One per line rather than one array, because a statement’s document is written the moment that statement finishes and a run that dies half way through still leaves the ones that did finish. A harness reading this wants the line for the query it timed, and a file it has to read to the end before it can parse any of it is a file it cannot get that from.
settings: SettingsHow results are printed, and everything that goes with it.