Skip to main content

Crate mariadb_cli

Crate mariadb_cli 

Source
Expand description

One-shot, agent-native command line client for MariaDB servers.

The process is born, does its work and dies within a single invocation. There is no daemon, no connection reused across invocations and no state that survives the process.

§Channels

The primary channel carries data only, in the published shape. Diagnostics, progress and warnings go to the auxiliary channel and never mix with data.

§Defence against unintended change

Three layers guard every statement, and only the first does not depend on reading the statement text correctly:

  1. Every statement travels as a prepared statement. The server refuses a prepared text that carries more than one statement, so the multiple command refusal lives on the server side. No local file handler is registered either, so a server request to read a client file fails.
  2. The statement is classified by its syntax tree before it is sent, over a text already stripped of comments and literals.
  3. Two defences do not depend on this tool behaving correctly, and the manual says so: a credential restricted on the server, and the read-only lock the server itself holds around work declared as reading. A statement that escaped classification would still be refused by the second one.

Modules§

cli
The published command surface.
commands
What each published command actually does.
config
Stored settings, and the one order in which a value is decided.
conn
The connection layer: how a named destination becomes an open session.
datamove
Moving data in and out of the server.
dispatch
Routing one parsed invocation to the command that serves it.
error
Structured failure: one closed shape for every way the product can fail.
exec
Sending a caller’s statement to the server, and everything that guards it.
history
Reading a table as it was, on the servers that keep that.
i18n
The language of messages written for a person.
introspect
Reading the structure of a server.
obs
The auxiliary channel: everything that is not the result.
output
The primary channel: data only, in the published shape.
runtime
Process lifetime: signals, cancellation and the work ceiling.
serverinfo
What the server is doing right now.
settings
Turning stored settings and command line marks into what each family needs.
sql
Statement analysis: the layer that decides whether a statement may be sent.
types
The published mapping from database types to output shapes.

Constants§

ENCRYPTED_CHANNEL_AVAILABLE
Whether this build carries network encryption.

Functions§

output_shape
The shape the primary channel is written in.
run
Runs one invocation from start to finish.