pub trait Queryable {
type ResultSet: Fetchable;
Show 16 methods
// Required methods
fn query<T>(&self, sql: T) -> Result<Self::ResultSet, Error>
where T: AsRef<str>;
fn query_with_req_id<T>(
&self,
sql: T,
req_id: u64
) -> Result<Self::ResultSet, Error>
where T: AsRef<str>;
fn write_raw_meta(&self, _: &RawMeta) -> Result<(), Error>;
fn write_raw_block(&self, _: &RawBlock) -> Result<(), Error>;
fn write_raw_block_with_req_id(
&self,
_: &RawBlock,
_: u64
) -> Result<(), Error>;
fn put(&self, data: &SmlData) -> Result<(), Error>;
// Provided methods
fn exec<T>(&self, sql: T) -> Result<usize, Error>
where T: AsRef<str> { ... }
fn exec_many<T, I>(&self, input: I) -> Result<usize, Error>
where T: AsRef<str>,
I: IntoIterator<Item = T> { ... }
fn query_one<T, O>(&self, sql: T) -> Result<Option<O>, Error>
where T: AsRef<str>,
O: DeserializeOwned { ... }
fn server_version(&self) -> Result<Cow<'_, str>, Error> { ... }
fn create_topic(
&self,
name: impl AsRef<str>,
sql: impl AsRef<str>
) -> Result<(), Error> { ... }
fn create_topic_as_database(
&self,
name: impl AsRef<str>,
db: impl Display
) -> Result<(), Error> { ... }
fn databases(&self) -> Result<Vec<ShowDatabase>, Error> { ... }
fn topics(&self) -> Result<Vec<Topic>, Error> { ... }
fn describe(&self, table: &str) -> Result<Describe, Error> { ... }
fn database_exists(&self, name: &str) -> Result<bool, Error> { ... }
}
Expand description
The synchronous query trait for TDengine connection.
Required Associated Types§
Required Methods§
fn query<T>(&self, sql: T) -> Result<Self::ResultSet, Error>
fn query_with_req_id<T>( &self, sql: T, req_id: u64 ) -> Result<Self::ResultSet, Error>
fn write_raw_meta(&self, _: &RawMeta) -> Result<(), Error>
fn write_raw_block(&self, _: &RawBlock) -> Result<(), Error>
fn write_raw_block_with_req_id(&self, _: &RawBlock, _: u64) -> Result<(), Error>
fn put(&self, data: &SmlData) -> Result<(), Error>
Provided Methods§
fn exec<T>(&self, sql: T) -> Result<usize, Error>
fn exec_many<T, I>(&self, input: I) -> Result<usize, Error>
fn query_one<T, O>(&self, sql: T) -> Result<Option<O>, Error>
sourcefn server_version(&self) -> Result<Cow<'_, str>, Error>
fn server_version(&self) -> Result<Cow<'_, str>, Error>
Short for SELECT server_version()
as String.
fn create_topic( &self, name: impl AsRef<str>, sql: impl AsRef<str> ) -> Result<(), Error>
fn create_topic_as_database( &self, name: impl AsRef<str>, db: impl Display ) -> Result<(), Error>
fn databases(&self) -> Result<Vec<ShowDatabase>, Error>
sourcefn topics(&self) -> Result<Vec<Topic>, Error>
fn topics(&self) -> Result<Vec<Topic>, Error>
Topics information by SELECT * FROM information_schema.ins_topics
sql.
§Compatibility
This is a 3.x-only API.
fn describe(&self, table: &str) -> Result<Describe, Error>
Object Safety§
This trait is not object safe.