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