Skip to main content

PolicyError

Type Alias PolicyError 

Source
pub type PolicyError<P> = Error<<P as Policy>::Failure, <P as Policy>::Refusal>;
Expand description

The error a connection judged by P returns.

Aliased Type§

pub enum PolicyError<P> {
Show 15 variants Sqlite(Error), DamagedDatabase, Refused(<P as Policy>::Refusal), StatementForbidden { operation: &'static str, }, TransactionEnded, Closed, Bug(Bug), HandleFailed(Bug), Host(<P as Policy>::Failure), Invariant { what: &'static str, }, WalUnavailable { mode: String, }, SqliteSettingOutOfRange { setting: &'static str, maximum: u64, }, UpkeepThread(Error), Path { path: PathBuf, source: Error, }, Rollback { operation: Box<Error<<P as Policy>::Failure, <P as Policy>::Refusal>>, rollback: Error, },
}

Variants§

§

Sqlite(Error)

SQLite refused or failed a statement, preserving its error.

§

DamagedDatabase

A statement met damage SQLite reports (SQLITE_CORRUPT, SQLITE_NOTADB).

§

Refused(<P as Policy>::Refusal)

The host’s policy, or one of the host’s SQL functions, refused a statement with this refusal.

§

StatementForbidden

App SQL tried transaction control, a PRAGMA, ATTACH, loading an extension, changing a hidden rowid, or changing the schema outside a migration.

Fields

§operation: &'static str

The refused operation.

§

TransactionEnded

SQLite rolled the owned transaction back itself, so it can’t go on.

§

Closed

The handle has closed the database.

§

Bug(Bug)

The call’s work panicked: a bug, which the caller reports.

§

HandleFailed(Bug)

An earlier bug may have left the handle’s state wrong, so the handle failed with it, and every call fails with it until the host reopens the database.

§

Host(<P as Policy>::Failure)

The host failed the handle with this failure.

§

Invariant

sqlive broke a rule it relies on: a bug, not damage.

Fields

§what: &'static str

The broken rule.

§

WalUnavailable

SQLite kept another journal mode instead of WAL.

Fields

§mode: String

The journal mode SQLite selected.

§

SqliteSettingOutOfRange

A SQLite setting is larger than SQLite can hold.

Fields

§setting: &'static str

The setting’s PRAGMA name.

§maximum: u64

The largest value SQLite holds for it.

§

UpkeepThread(Error)

The system refused a thread of sqlive’s upkeep, so the database did not open.

§

Path

Opening the database’s file at path failed. Only on Windows can a name in the path mean another file once sqlive drops the path’s verbatim prefix.

Fields

§path: PathBuf

The database file.

§source: Error

What the file system answered.

§

Rollback

A transaction failed and rolling it back failed too. The handle fails with EngineFailure::Rollback.

Fields

§operation: Box<Error<<P as Policy>::Failure, <P as Policy>::Refusal>>

The operation that required rollback.

§rollback: Error

SQLite’s rollback failure.