pub struct Server { /* private fields */ }Expand description
A running ClickHouse server. Dropping it kills the process and removes its directory; Server::stop lets
it shut down first, which releases its InodeDB lease.
Implementations§
Source§impl Server
impl Server
Sourcepub async fn start(
env: &StockEnv,
config: &ServerConfig,
) -> Result<Server, Error>
pub async fn start( env: &StockEnv, config: &ServerConfig, ) -> Result<Server, Error>
Boots a server and waits for it to answer.
pub fn name(&self) -> &str
pub fn dir(&self) -> &Path
pub fn http_port(&self) -> u16
pub fn tcp_port(&self) -> u16
Sourcepub async fn query(&self, sql: &str) -> Result<String, Error>
pub async fn query(&self, sql: &str) -> Result<String, Error>
Runs a statement and returns its output.
Sourcepub async fn query_with(
&self,
sql: &str,
settings: &[(&str, &str)],
) -> Result<String, Error>
pub async fn query_with( &self, sql: &str, settings: &[(&str, &str)], ) -> Result<String, Error>
Runs a statement under settings and returns its output.
Sourcepub async fn run(
&self,
sql: &str,
settings: &[(&str, &str)],
body: Bytes,
) -> Result<Answer, Error>
pub async fn run( &self, sql: &str, settings: &[(&str, &str)], body: Bytes, ) -> Result<Answer, Error>
Runs a statement under settings, with body as its data.
Sourcepub async fn add_config(&self, file_name: &str, xml: &str) -> Result<(), Error>
pub async fn add_config(&self, file_name: &str, xml: &str) -> Result<(), Error>
Writes a file into the server’s config.d and has the server reload its config.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Forget for Server
impl Freeze for Server
impl Move for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request