pub trait AsyncDdl: AsyncSocket {
fn switch<'s, T: IntoSkyhashBytes + 's>(
&'s mut self,
entity: T
) -> AsyncResult<'_, SkyResult<()>> { ... }
fn create_keyspace<'s>(
&'s mut self,
ks: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>> { ... }
fn create_table<'s>(
&'s mut self,
table: impl CreateTableIntoQuery + 's
) -> AsyncResult<'_, SkyResult<()>> { ... }
fn drop_table<'s>(
&'s mut self,
table: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>> { ... }
fn drop_keyspace<'s>(
&'s mut self,
keyspace: impl IntoSkyhashBytes + 's,
force: bool
) -> AsyncResult<'_, SkyResult<()>> { ... }
fn whereami<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<WhereAmI>> { ... }
}
This is supported on crate feature
aio
only.Expand description
DDL queries that can be run on async socket connections
Provided methods
fn switch<'s, T: IntoSkyhashBytes + 's>(
&'s mut self,
entity: T
) -> AsyncResult<'_, SkyResult<()>>
fn switch<'s, T: IntoSkyhashBytes + 's>(
&'s mut self,
entity: T
) -> AsyncResult<'_, SkyResult<()>>
This function switches to the provided entity.
This is equivalent to:
USE <entity>
Example
use skytable::ddl::Ddl;
use skytable::sync::Connection;
let mut con = Connection::new("127.0.0.1", 2003).unwrap();
con.switch("mykeyspace:mytable").unwrap();
fn create_keyspace<'s>(
&'s mut self,
ks: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn create_keyspace<'s>(
&'s mut self,
ks: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
Create the provided keyspace
This is equivalent to:
CREATE KEYSPACE <ksname>
This will return true if the keyspace was created or false if the keyspace already exists
fn create_table<'s>(
&'s mut self,
table: impl CreateTableIntoQuery + 's
) -> AsyncResult<'_, SkyResult<()>>
fn create_table<'s>(
&'s mut self,
table: impl CreateTableIntoQuery + 's
) -> AsyncResult<'_, SkyResult<()>>
Create a table from the provided configuration
fn drop_table<'s>(
&'s mut self,
table: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn drop_table<'s>(
&'s mut self,
table: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
Drop the provided table
This returns true if the table was removed for false if the table didn’t exist
fn drop_keyspace<'s>(
&'s mut self,
keyspace: impl IntoSkyhashBytes + 's,
force: bool
) -> AsyncResult<'_, SkyResult<()>>
fn drop_keyspace<'s>(
&'s mut self,
keyspace: impl IntoSkyhashBytes + 's,
force: bool
) -> AsyncResult<'_, SkyResult<()>>
Drop the provided keyspace
fn whereami<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<WhereAmI>>
fn whereami<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<WhereAmI>>
Check what keyspace this connection is currently connected to