pub struct DeployClient {
pub command: &'static str,
pub run_file: &'static [&'static str],
pub read_rows: Option<&'static [&'static str]>,
pub block_terminator: Option<BlockTerminator>,
}Expand description
A client described by the dialect, so razeri can write a deploy script around it.
Razeri writes one deploy.sh for every such client. It runs the bundle’s
files in order through the client — the prerequisites, the schema, the
staging fill, the loads — stops at the first file the engine refuses, and
then reads the reconciliation back and grades it. All it asks of the
dialect is how the client is called. Razeri has never run that script
against your engine, and the bundle says so: proving it is a run of your
own.
In each argument, {file} stands for the file being run and {target}
for the database the operator names, as the script’s first argument or in
RAZERI_TARGET. The operator can point the script at another copy of the
client with RAZERI_CLIENT.
SQLite’s own client, described this way:
use razeri_plugin_api::{DeployClient, DeployScript};
const SQLITE3: DeployScript = DeployScript::Client(DeployClient {
command: "sqlite3",
run_file: &["-bail", "{target}", ".read {file}"],
read_rows: Some(&["-csv", "-noheader", "{target}", ".read {file}"]),
block_terminator: None,
});Fields§
§command: &'static strThe client’s command, as an operator has it on PATH.
run_file: &'static [&'static str]The arguments that run one file of SQL and stop at the first statement the engine refuses, exiting non-zero.
The script reads nothing but the client’s exit code, so a client that
carries on past a refusal, or exits zero after one, deploys part of a
warehouse and reports it done. Name the option that makes yours stop;
sqlite3 calls it -bail.
read_rows: Option<&'static [&'static str]>The arguments that run one query file and print its rows as comma-separated values, one row per line, with no header: how the script reads the reconciliation back to grade it.
None where the client cannot. The script then stops after the loads,
exits with the code for nothing was compared, and says the
reconciliation is the operator’s to run.
block_terminator: Option<BlockTerminator>How this client is told where a routine ends, or None where a
routine ends the way every statement does.
A routine’s body holds statements of its own, each ending in ;, and
some clients end the routine at the first of them: Firebird’s isql
needs SET TERM ^ ; before a routine, the routine ended with ^, and
SET TERM ; ^ after it. Razeri writes these three around each
procedure and function in the files the script runs.