pub struct OnchainDataResult {
pub metadata: Option<OnchainDataResultMetadata>,
pub result: Vec<Map<String, Value>>,
pub schema: Option<OnchainDataResultSchema>,
}
Expand description
Result of executing a SQL query.
JSON schema
{
"description": "Result of executing a SQL query.",
"type": "object",
"properties": {
"metadata": {
"description": "Metadata about query execution.",
"examples": [
{
"cached": false,
"executionTimeMs": 145,
"rowCount": 2
}
],
"type": "object",
"properties": {
"cached": {
"description": "Whether the result was served from cache.",
"examples": [
false
],
"type": "boolean"
},
"executionTimeMs": {
"description": "Query execution time in milliseconds.",
"examples": [
145
],
"type": "integer"
},
"rowCount": {
"description": "Number of rows returned.",
"examples": [
2
],
"type": "integer"
}
}
},
"result": {
"description": "Query result as an array of objects representing rows.",
"examples": [
[
{
"amount": 1000000000000000000,
"event_signature": "Transfer(address,address,uint256)",
"from": "0x1234567890abcdef",
"to": "0x1234567890abcdef"
},
{
"amount": 2000000000000000000,
"event_signature": "Transfer(address,address,uint256)",
"from": "0x1234567890abcdef",
"to": "0x1234567890abcdef"
}
]
],
"type": "array",
"items": {
"description": "Row data with column names as keys.",
"examples": [
{
"amount": 1000000000000000000,
"event_signature": "Transfer(address,address,uint256)",
"from": "0x1234567890abcdef",
"to": "0x1234567890abcdef"
}
],
"type": "object",
"additionalProperties": true
}
},
"schema": {
"description": "Schema information for the query result. This is a derived schema from the query result, so types may not match the underlying table.\n",
"examples": [
{
"columns": [
{
"name": "block_number",
"type": "UInt64"
},
{
"name": "transaction_hash",
"type": "String"
}
]
}
],
"type": "object",
"properties": {
"columns": {
"description": "Column definitions.",
"type": "array",
"items": {
"examples": [
{
"description": "The signature of the event.",
"name": "event_signature",
"type": "String"
}
],
"type": "object",
"properties": {
"name": {
"description": "Column name.",
"type": "string"
},
"type": {
"description": "Column data type (ClickHouse types).",
"type": "string",
"enum": [
"String",
"UInt8",
"UInt16",
"UInt32",
"UInt64",
"UInt128",
"UInt256",
"Int8",
"Int16",
"Int32",
"Int64",
"Int128",
"Int256",
"Float32",
"Float64",
"Bool",
"Date",
"DateTime",
"DateTime64",
"UUID"
]
}
}
}
}
}
}
}
}
Fields§
§metadata: Option<OnchainDataResultMetadata>
§result: Vec<Map<String, Value>>
Query result as an array of objects representing rows.
schema: Option<OnchainDataResultSchema>
Implementations§
Source§impl OnchainDataResult
impl OnchainDataResult
pub fn builder() -> OnchainDataResult
Trait Implementations§
Source§impl Clone for OnchainDataResult
impl Clone for OnchainDataResult
Source§fn clone(&self) -> OnchainDataResult
fn clone(&self) -> OnchainDataResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OnchainDataResult
impl Debug for OnchainDataResult
Source§impl Default for OnchainDataResult
impl Default for OnchainDataResult
Source§impl<'de> Deserialize<'de> for OnchainDataResult
impl<'de> Deserialize<'de> for OnchainDataResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&OnchainDataResult> for OnchainDataResult
impl From<&OnchainDataResult> for OnchainDataResult
Source§fn from(value: &OnchainDataResult) -> Self
fn from(value: &OnchainDataResult) -> Self
Converts to this type from the input type.
Source§impl From<OnchainDataResult> for OnchainDataResult
impl From<OnchainDataResult> for OnchainDataResult
Source§fn from(value: OnchainDataResult) -> Self
fn from(value: OnchainDataResult) -> Self
Converts to this type from the input type.
Source§impl Serialize for OnchainDataResult
impl Serialize for OnchainDataResult
Source§impl TryFrom<OnchainDataResult> for OnchainDataResult
impl TryFrom<OnchainDataResult> for OnchainDataResult
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: OnchainDataResult) -> Result<Self, ConversionError>
fn try_from(value: OnchainDataResult) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for OnchainDataResult
impl RefUnwindSafe for OnchainDataResult
impl Send for OnchainDataResult
impl Sync for OnchainDataResult
impl Unpin for OnchainDataResult
impl UnwindSafe for OnchainDataResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more