pub struct Connection<S> {
stash: S,
cluster_id: Uuid,
}
Fields
stash: S
cluster_id: Uuid
Implementations
sourceimpl<S: Append> Connection<S>
impl<S: Append> Connection<S>
pub async fn open(stash: S) -> Result<Connection<S>, Error>
sourceimpl<S: Append> Connection<S>
impl<S: Append> Connection<S>
async fn get_setting(&mut self, key: &str) -> Result<Option<String>, Error>
async fn set_setting(&mut self, key: &str, value: &str) -> Result<(), Error>
async fn get_setting_stash(
stash: &mut impl Stash,
key: &str
) -> Result<Option<String>, Error>
async fn set_setting_stash<V: Into<String> + Display>(
stash: &mut impl Append,
key: &str,
value: V
) -> Result<(), Error>
sourceasync fn set_or_get_cluster_id(stash: &mut impl Append) -> Result<Uuid, Error>
async fn set_or_get_cluster_id(stash: &mut impl Append) -> Result<Uuid, Error>
Sets catalog’s cluster_id
setting on initialization or gets that value.
pub async fn get_catalog_content_version(
&mut self
) -> Result<Option<String>, Error>
pub async fn set_catalog_content_version(
&mut self,
new_version: &str
) -> Result<(), Error>
pub async fn load_databases(
&mut self
) -> Result<Vec<(DatabaseId, String)>, Error>
pub async fn load_schemas(
&mut self
) -> Result<Vec<(SchemaId, String, Option<DatabaseId>)>, Error>
pub async fn load_roles(&mut self) -> Result<Vec<(u64, String)>, Error>
pub async fn load_compute_instances(
&mut self
) -> Result<Vec<(ComputeInstanceId, String, Option<ComputeInstanceIntrospectionConfig>)>, Error>
pub async fn load_compute_instance_replicas(
&mut self
) -> Result<Vec<(ComputeInstanceId, ReplicaId, String, ConcreteComputeInstanceReplicaConfig)>, Error>
pub async fn load_audit_log(
&mut self
) -> Result<impl Iterator<Item = Vec<u8>>, Error>
sourcepub async fn load_system_gids(
&mut self
) -> Result<BTreeMap<(String, String), (GlobalId, u64)>, Error>
pub async fn load_system_gids(
&mut self
) -> Result<BTreeMap<(String, String), (GlobalId, u64)>, Error>
Load the persisted mapping of system object to global ID. Key is (schema-name, object-name).
pub async fn load_introspection_source_index_gids(
&mut self,
compute_id: ComputeInstanceId
) -> Result<BTreeMap<String, GlobalId>, Error>
sourcepub async fn set_system_gids(
&mut self,
mappings: Vec<(&str, &str, GlobalId, u64)>
) -> Result<(), Error>
pub async fn set_system_gids(
&mut self,
mappings: Vec<(&str, &str, GlobalId, u64)>
) -> Result<(), Error>
Persist mapping from system objects to global IDs. Each element of mappings
should be
(schema-name, object-name, global-id).
Panics if provided id is not a system id
sourcepub async fn set_introspection_source_index_gids(
&mut self,
mappings: Vec<(ComputeInstanceId, &str, GlobalId)>
) -> Result<(), Error>
pub async fn set_introspection_source_index_gids(
&mut self,
mappings: Vec<(ComputeInstanceId, &str, GlobalId)>
) -> Result<(), Error>
Panics if provided id is not a system id
pub async fn allocate_system_ids(
&mut self,
amount: u64
) -> Result<Vec<GlobalId>, Error>
pub async fn allocate_user_id(&mut self) -> Result<GlobalId, Error>
async fn allocate_id(
&mut self,
id_type: &str,
amount: u64
) -> Result<Vec<u64>, Error>
pub async fn transaction<'a>(&'a mut self) -> Result<Transaction<'a, S>, Error>
pub fn cluster_id(&self) -> Uuid
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for Connection<S> where
S: RefUnwindSafe,
impl<S> Send for Connection<S> where
S: Send,
impl<S> Sync for Connection<S> where
S: Sync,
impl<S> Unpin for Connection<S> where
S: Unpin,
impl<S> UnwindSafe for Connection<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<P, R> ProtoType<R> for P where
R: RustType<P>,
impl<P, R> ProtoType<R> for P where
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See RustType::from_proto
.
sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See RustType::into_proto
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more