pub enum Argument {
Column(ColumnDeclaration),
Config(ConfigOption),
}
Expand description
A successfully parsed Argument from a virtual table constructor. A single constructor can have multiple arguments, this struct only represents a single one.
In this parser, the above constructor in xxx
has 5 arguments -
2 “configuration options” and “column declarations.” The mode
argument is a configuration option with a key of "mode"
and
a quoted string value of "production"
. Similarly, state
is
a configuration argument with key "state"
and a bareword
value of null
. On the other hand, name
, age
, and progress
are arguments that declare columns, with declared types text
,
integer
, and real
, respectfully.
The virtual table implementations can do whatever they want with the parsed arguments, including by not limited to erroring on invalid options, creating new columns on the virtual table based on the column definitions, requiring certain config options, or anything else they want. A single parsed argument from a virtual table constructor. Can be a column declaration onf configuration option.
Variants§
Column(ColumnDeclaration)
The argument declares a column - ex “name text” or “age integer”. Like SQLite, a column declartion can have 0 or any declared types, and also tries to capture any “constraints”.
Config(ConfigOption)
The argument defines a configuration option - ex “mode=fast” or “tokenize = ‘porter ascii’”. The key is always a string, the value can be “rich” types like strings, booleans, numbers, sqlite_parameters, or barewords.