#[non_exhaustive]pub enum Api {
Show 43 variants
Query(String),
Http(String),
Ws(String),
Scheme(String),
ConnectionUninitialised,
AlreadyConnected,
InvalidBindings(Value),
RangeOnRecordId(Thing),
RangeOnObject(Object),
RangeOnArray(Array),
RangeOnEdges(Edges),
TableColonId {
table: String,
id: String,
},
DuplicateRequestId(i64),
InvalidRequest(String),
InvalidParams(String),
InternalError(String),
ParseError(String),
InvalidSemanticVersion(String),
InvalidUrl(String),
FromValue {
value: Value,
error: String,
},
ResponseFromBinary {
binary: Vec<u8>,
error: Error,
},
ToJsonString {
value: Value,
error: String,
},
FromJsonString {
string: String,
error: String,
},
InvalidNsName(String),
InvalidDbName(String),
FileOpen {
path: PathBuf,
error: Error,
},
FileRead {
path: PathBuf,
error: Error,
},
LossyTake(Response),
BackupsNotSupported,
VersionMismatch {
server_version: Version,
supported_versions: String,
},
BuildMetadataMismatch {
server_metadata: BuildMetadata,
supported_metadata: BuildMetadata,
},
LiveQueriesNotSupported,
LiveOnObject(Object),
LiveOnArray(Array),
LiveOnEdges(Edges),
NotLiveQuery(usize),
QueryIndexOutOfBounds(usize),
ResponseAlreadyTaken,
InsertOnObject(Object),
InsertOnArray(Array),
InsertOnEdges(Edges),
InvalidNetTarget(ParseNetTargetError),
InvalidFuncTarget(ParseFuncTargetError),
}
Expand description
An error originating from a remote SurrealDB database
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Query(String)
There was an error processing the query
Http(String)
There was an error processing a remote HTTP request
Ws(String)
There was an error processing a remote WS request
Scheme(String)
The specified scheme does not match any supported protocol or storage engine
ConnectionUninitialised
Tried to run database queries without initialising the connection first
AlreadyConnected
Tried to call connect
on an instance already connected
InvalidBindings(Value)
Query::bind
not called with an object nor a key/value tuple
RangeOnRecordId(Thing)
Tried to use a range query on a record ID
RangeOnObject(Object)
Tried to use a range query on an object
RangeOnArray(Array)
Tried to use a range query on an array
RangeOnEdges(Edges)
Tried to use a range query on an edge or edges
TableColonId
Tried to use table:id
syntax as a method parameter when (table, id)
should be used instead
DuplicateRequestId(i64)
Duplicate request ID
InvalidRequest(String)
Invalid request
InvalidParams(String)
Invalid params
InternalError(String)
Internal server error
ParseError(String)
Parse error
InvalidSemanticVersion(String)
Invalid semantic version
InvalidUrl(String)
Invalid URL
FromValue
Failed to convert a sql::Value
to T
ResponseFromBinary
Failed to deserialize a binary response
ToJsonString
Failed to serialize sql::Value
to JSON string
FromJsonString
Failed to deserialize from JSON string to sql::Value
InvalidNsName(String)
Invalid namespace name
InvalidDbName(String)
Invalid database name
FileOpen
File open error
FileRead
File read error
LossyTake(Response)
Tried to take only a single result when the query returned multiple records
BackupsNotSupported
The protocol or storage engine being used does not support backups on the architecture it’s running on
VersionMismatch
The version of the server is not compatible with the versions supported by this SDK
BuildMetadataMismatch
The build metadata of the server is older than the minimum supported by this SDK
LiveQueriesNotSupported
The protocol or storage engine being used does not support live queries on the architecture it’s running on
LiveOnObject(Object)
Tried to use a range query on an object
LiveOnArray(Array)
Tried to use a range query on an array
LiveOnEdges(Edges)
Tried to use a range query on an edge or edges
NotLiveQuery(usize)
Tried to access a query statement as a live query when it isn’t a live query
QueryIndexOutOfBounds(usize)
Tried to access a query statement falling outside the bounds of the statements supplied
ResponseAlreadyTaken
Called Response::take
or Response::stream
on a query response more than once
InsertOnObject(Object)
Tried to insert on an object
InsertOnArray(Array)
Tried to insert on an array
InsertOnEdges(Edges)
Tried to insert on an edge or edges