Struct skytable::sync::Connection
source · pub struct Connection { /* private fields */ }Available on crate feature
sync only.Expand description
A database connection over Skyhash/TCP
Implementations§
source§impl Connection
impl Connection
source§impl Connection
impl Connection
sourcepub fn run_query<T: FromSkyhashBytes, Q: AsRef<Query>>(
&mut self,
query: Q
) -> SkyResult<T>
pub fn run_query<T: FromSkyhashBytes, Q: AsRef<Query>>( &mut self, query: Q ) -> SkyResult<T>
Runs a query using Self::run_query_raw and attempts to return a type provided by the user
sourcepub fn run_query_raw<Q: AsRef<Query>>(&mut self, query: Q) -> SkyResult<Element>
pub fn run_query_raw<Q: AsRef<Query>>(&mut self, query: Q) -> SkyResult<Element>
This function will write a Query to the stream and read the response from the
server. It will then determine if the returned response is complete or incomplete
or invalid and return an appropriate variant of Error wrapped in [IoResult]
for any I/O errors that may occur
Panics
This method will panic:
- if the
Querysupplied is empty (i.e has no arguments) This function is a subroutine ofrun_queryused to parse the response packet
pub fn run_simple_query(&mut self, query: &Query) -> SkyQueryResult
👎Deprecated since 0.7.0: this will be removed in a future release. consider using <code>run_query_raw</code> instead
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations§
source§impl<T> Actions for Twhere
T: SyncSocket,
impl<T> Actions for Twhere T: SyncSocket,
source§fn dbsize<'s>(&'s mut self) -> SkyResult<u64>
fn dbsize<'s>(&'s mut self) -> SkyResult<u64>
Available on crate feature
sync only.Get the number of keys present in the database
source§fn del<'s>(&'s mut self, key: impl IntoSkyhashAction + 's) -> SkyResult<u64>
fn del<'s>(&'s mut self, key: impl IntoSkyhashAction + 's) -> SkyResult<u64>
Available on crate feature
sync only.Deletes a single or a number of keys Read more
source§fn exists<'s>(&'s mut self, key: impl IntoSkyhashAction + 's) -> SkyResult<u64>
fn exists<'s>(&'s mut self, key: impl IntoSkyhashAction + 's) -> SkyResult<u64>
Available on crate feature
sync only.Checks if a key (or keys) exist(s) Read more
source§fn flushdb<'s>(&'s mut self) -> SkyResult<()>
fn flushdb<'s>(&'s mut self) -> SkyResult<()>
Available on crate feature
sync only.Removes all the keys present in the database
source§fn get<'s, T: FromSkyhashBytes>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> SkyResult<T>
fn get<'s, T: FromSkyhashBytes>( &'s mut self, key: impl IntoSkyhashBytes + 's ) -> SkyResult<T>
Available on crate feature
sync only.Get the value of a key Read more
source§fn keylen<'s>(&'s mut self, key: impl IntoSkyhashBytes + 's) -> SkyResult<u64>
fn keylen<'s>(&'s mut self, key: impl IntoSkyhashBytes + 's) -> SkyResult<u64>
Available on crate feature
sync only.Get the length of a key Read more
source§fn lskeys<'s, T: FromSkyhashBytes>(&'s mut self, count: u64) -> SkyResult<T>
fn lskeys<'s, T: FromSkyhashBytes>(&'s mut self, count: u64) -> SkyResult<T>
Available on crate feature
sync only.Returns a vector of keys Read more
source§fn mget<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> SkyResult<T>
fn mget<'s, T: FromSkyhashBytes>( &'s mut self, keys: impl IntoSkyhashAction + 's ) -> SkyResult<T>
Available on crate feature
sync only.Get multiple keys Read more
source§fn mksnap<'s>(&'s mut self) -> SkyResult<SnapshotResult>
fn mksnap<'s>(&'s mut self) -> SkyResult<SnapshotResult>
Available on crate feature
sync only.Creates a snapshot Read more
source§fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> SkyResult<u64>
fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>( &'s mut self, keys: impl GetIterator<T> + 's, values: impl GetIterator<U> + 's ) -> SkyResult<u64>
Available on crate feature
sync only.Sets the value of multiple keys and values and returns the number of keys that were set Read more
source§fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> SkyResult<u64>
fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>( &'s mut self, keys: impl GetIterator<T> + 's, values: impl GetIterator<U> + 's ) -> SkyResult<u64>
Available on crate feature
sync only.Updates the value of multiple keys and values and returns the number of keys that were updated Read more
source§fn pop<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashBytes + 's
) -> SkyResult<T>
fn pop<'s, T: FromSkyhashBytes>( &'s mut self, keys: impl IntoSkyhashBytes + 's ) -> SkyResult<T>
Available on crate feature
sync only.Consumes a key if it exists Read more
source§fn mpop<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> SkyResult<T>
fn mpop<'s, T: FromSkyhashBytes>( &'s mut self, keys: impl IntoSkyhashAction + 's ) -> SkyResult<T>
Available on crate feature
sync only.Consumes the provided keys if they exist Read more
source§fn sdel<'s>(&'s mut self, keys: impl IntoSkyhashAction + 's) -> SkyResult<bool>
fn sdel<'s>(&'s mut self, keys: impl IntoSkyhashAction + 's) -> SkyResult<bool>
Available on crate feature
sync only.Deletes all the provided keys if they exist or doesn’t do anything at all. This method
will return true if all the provided keys were deleted, else it will return false Read more
source§fn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> SkyResult<bool>
fn set<'s>( &'s mut self, key: impl IntoSkyhashBytes + 's, value: impl IntoSkyhashBytes + 's ) -> SkyResult<bool>
Available on crate feature
sync only.Set the value of a key Read more
source§fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> SkyResult<bool>
fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>( &'s mut self, keys: impl GetIterator<T> + 's, values: impl GetIterator<U> + 's ) -> SkyResult<bool>
Available on crate feature
sync only.Sets the value of all the provided keys or does nothing. This method will return true if all the keys
were set or will return false if none were set Read more
source§fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> SkyResult<bool>
fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>( &'s mut self, keys: impl GetIterator<T> + 's, values: impl GetIterator<U> + 's ) -> SkyResult<bool>
Available on crate feature
sync only.Updates the value of all the provided keys or does nothing. This method will return true if all the keys
were updated or will return false if none were updated. Read more
source§fn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> SkyResult<()>
fn update<'s>( &'s mut self, key: impl IntoSkyhashBytes + 's, value: impl IntoSkyhashBytes + 's ) -> SkyResult<()>
Available on crate feature
sync only.Update the value of a key Read more
source§fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> SkyResult<u64>
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>( &'s mut self, keys: impl GetIterator<T> + 's, values: impl GetIterator<U> + 's ) -> SkyResult<u64>
Available on crate feature
sync only.Updates or sets all the provided keys and returns the number of keys that were set Read more
source§fn auth_claim<'s>(&'s mut self, origin_key: OriginKey) -> SkyResult<String>
fn auth_claim<'s>(&'s mut self, origin_key: OriginKey) -> SkyResult<String>
Available on crate feature
sync only.Attempt to claim the root account using the given
origin_key. This will return the
root user tokensource§fn auth_login<'s>(&'s mut self, user: &'s str, token: &'s str) -> SkyResult<()>
fn auth_login<'s>(&'s mut self, user: &'s str, token: &'s str) -> SkyResult<()>
Available on crate feature
sync only.Attempt to authenticate using the given
user and tokensource§fn auth_logout<'s>(&'s mut self) -> SkyResult<()>
fn auth_logout<'s>(&'s mut self) -> SkyResult<()>
Available on crate feature
sync only.Attempt to log out
source§impl<T> Ddl for Twhere
T: SyncSocket,
impl<T> Ddl for Twhere T: SyncSocket,
source§fn switch<'s, T: IntoSkyhashBytes + 's>(
&'s mut self,
entity: T
) -> SkyResult<()>
fn switch<'s, T: IntoSkyhashBytes + 's>( &'s mut self, entity: T ) -> SkyResult<()>
Available on crate feature
sync only.This function switches to the provided entity. Read more
source§fn create_keyspace<'s>(
&'s mut self,
ks: impl IntoSkyhashBytes + 's
) -> SkyResult<bool>
fn create_keyspace<'s>( &'s mut self, ks: impl IntoSkyhashBytes + 's ) -> SkyResult<bool>
Available on crate feature
sync only.Create the provided keyspace Read more
source§fn create_table<'s>(
&'s mut self,
table: impl CreateTableIntoQuery + 's
) -> SkyResult<()>
fn create_table<'s>( &'s mut self, table: impl CreateTableIntoQuery + 's ) -> SkyResult<()>
Available on crate feature
sync only.Create a table from the provided configuration
source§fn drop_table<'s>(
&'s mut self,
table: impl IntoSkyhashBytes + 's
) -> SkyResult<bool>
fn drop_table<'s>( &'s mut self, table: impl IntoSkyhashBytes + 's ) -> SkyResult<bool>
Available on crate feature
sync only.Drop the provided table Read more
source§fn drop_keyspace<'s>(
&'s mut self,
keyspace: impl IntoSkyhashBytes + 's,
force: bool
) -> SkyResult<()>
fn drop_keyspace<'s>( &'s mut self, keyspace: impl IntoSkyhashBytes + 's, force: bool ) -> SkyResult<()>
Available on crate feature
sync only.Drop the provided keyspace