pub enum SqlError {
Show 15 variants
UnsupportedScheme(String),
InvalidUrl(String),
BackendDisabled(String),
ConnectionFailed(String),
QueryFailed(String),
BulkUnavailable(String),
TlsError(String),
Io(Error),
SshHostKeyMismatch {
host: String,
port: u16,
},
SshUnknownHost {
host: String,
port: u16,
algorithm: String,
fingerprint: String,
key: Box<PublicKey>,
},
Timeout,
CellTooLarge {
row: u64,
column: String,
size: usize,
cap: usize,
},
RowTooLarge {
row: u64,
size: usize,
cap: usize,
},
BufferTooLarge {
rows_buffered: u64,
cap: usize,
},
RegistryError(String),
}Expand description
Errors originating in the ferrule-sql driver and write-path layer.
Every backend method, URL parse, connect dispatch, transaction
helper, and copy routine returns this type. Variant names and tuple
shapes are load-bearing across the workspace (the CLI pattern-matches
SqlError::QueryFailed in several hot paths), so preserve them when
editing.
RegistryError is registry/CLI-level rather than driver-level; it
rides along here as a deliberate minimal-diff choice during the
ferrule-core -> ferrule-sql extraction and is a candidate for a
later relocation to a core-side error type.
Variants§
UnsupportedScheme(String)
InvalidUrl(String)
BackendDisabled(String)
ConnectionFailed(String)
QueryFailed(String)
Backend-native bulk-load path is not usable at runtime (server config, missing capability, permission denied, target relation is not a base table, etc.). Callers may retry on the generic INSERT path. The string is intended for stderr only; do not match on it.
TlsError(String)
Io(Error)
SshHostKeyMismatch
Host key mismatch during SSH tunnel setup (always fatal).
SshUnknownHost
Unknown host during SSH tunnel setup (can be TOFU-prompted interactively by the CLI layer).
Fields
Timeout
CellTooLarge
A single cell exceeded the configured max_cell_bytes guard.
Raised by the read paths (streaming cursor and eager query)
before the offending value is retained, so the guard caps
peak memory at one over-budget cell rather than letting a
pathological bytea / TEXT blow the heap. row is the
0-based row ordinal within the current result; column names the
offending column; size and cap are byte counts.
RowTooLarge
A whole row’s measured byte size exceeded max_row_bytes.
Like CellTooLarge this fires before the
row is appended to any buffer, so an unexpectedly wide row fails
fast instead of being materialized. row is the 0-based ordinal;
size/cap are byte counts.
BufferTooLarge
The running total of buffered row bytes crossed
max_total_buffered_bytes while materializing an eager result.
This is the guard the CLI’s eager table path relies on: rather
than collect an unbounded Vec<Row> for a huge table, the eager
query accumulates a byte tally and aborts once it crosses the
cap. rows_buffered is how many rows had been accumulated; cap
is the byte ceiling.
RegistryError(String)
Trait Implementations§
Source§impl Error for SqlError
impl Error for SqlError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()