Struct mz_sql::catalog::DummyCatalog
source · pub struct DummyCatalog;
Expand description
A dummy SessionCatalog
implementation.
This implementation is suitable for use in tests that plan queries which are not demanding of the catalog, as many methods are unimplemented.
Trait Implementations§
source§impl Debug for DummyCatalog
impl Debug for DummyCatalog
source§impl ExprHumanizer for DummyCatalog
impl ExprHumanizer for DummyCatalog
source§fn humanize_id(&self, _: GlobalId) -> Option<String>
fn humanize_id(&self, _: GlobalId) -> Option<String>
Attempts to return the a human-readable string for the relation
identified by
id
.source§fn humanize_id_unqualified(&self, _: GlobalId) -> Option<String>
fn humanize_id_unqualified(&self, _: GlobalId) -> Option<String>
Same as above, but without qualifications, e.g., only
foo
for materialize.public.foo
.source§fn humanize_scalar_type(&self, _: &ScalarType) -> String
fn humanize_scalar_type(&self, _: &ScalarType) -> String
Returns a human-readable name for the specified scalar type.
source§fn humanize_column_type(&self, typ: &ColumnType) -> String
fn humanize_column_type(&self, typ: &ColumnType) -> String
Returns a human-readable name for the specified scalar type.
source§impl SessionCatalog for DummyCatalog
impl SessionCatalog for DummyCatalog
source§fn active_role_id(&self) -> &RoleId
fn active_role_id(&self) -> &RoleId
Returns the id of the role that is issuing the query.
source§fn active_database(&self) -> Option<&DatabaseId>
fn active_database(&self) -> Option<&DatabaseId>
Returns the database to use if one is not explicitly specified.
source§fn active_cluster(&self) -> &str
fn active_cluster(&self) -> &str
Returns the cluster to use if one is not explicitly specified.
source§fn search_path(&self) -> &[(ResolvedDatabaseSpecifier, SchemaSpecifier)]
fn search_path(&self) -> &[(ResolvedDatabaseSpecifier, SchemaSpecifier)]
Returns the resolved search paths for the current user. (Invalid search paths are skipped.)
source§fn get_prepared_statement_desc(&self, _: &str) -> Option<&StatementDesc>
fn get_prepared_statement_desc(&self, _: &str) -> Option<&StatementDesc>
Returns the descriptor of the named prepared statement on the session, or
None if the prepared statement does not exist.
source§fn resolve_database(&self, _: &str) -> Result<&dyn CatalogDatabase, CatalogError>
fn resolve_database(&self, _: &str) -> Result<&dyn CatalogDatabase, CatalogError>
Resolves the named database. Read more
source§fn get_database(&self, _: &DatabaseId) -> &dyn CatalogDatabase
fn get_database(&self, _: &DatabaseId) -> &dyn CatalogDatabase
Gets a database by its ID. Read more
source§fn resolve_schema(
&self,
_: Option<&str>,
_: &str
) -> Result<&dyn CatalogSchema, CatalogError>
fn resolve_schema(
&self,
_: Option<&str>,
_: &str
) -> Result<&dyn CatalogSchema, CatalogError>
Resolves a partially-specified schema name. Read more
source§fn resolve_schema_in_database(
&self,
_: &ResolvedDatabaseSpecifier,
_: &str
) -> Result<&dyn CatalogSchema, CatalogError>
fn resolve_schema_in_database(
&self,
_: &ResolvedDatabaseSpecifier,
_: &str
) -> Result<&dyn CatalogSchema, CatalogError>
Resolves a schema name within a specified database. Read more
source§fn get_schema(
&self,
_: &ResolvedDatabaseSpecifier,
_: &SchemaSpecifier
) -> &dyn CatalogSchema
fn get_schema(
&self,
_: &ResolvedDatabaseSpecifier,
_: &SchemaSpecifier
) -> &dyn CatalogSchema
Gets a schema by its ID. Read more
source§fn try_get_role(&self, _: &RoleId) -> Option<&dyn CatalogRole>
fn try_get_role(&self, _: &RoleId) -> Option<&dyn CatalogRole>
Gets a role by its ID.
source§fn is_system_schema(&self, _: &str) -> bool
fn is_system_schema(&self, _: &str) -> bool
Returns true if
schema
is an internal system schema, false otherwisesource§fn resolve_role(&self, _: &str) -> Result<&dyn CatalogRole, CatalogError>
fn resolve_role(&self, _: &str) -> Result<&dyn CatalogRole, CatalogError>
Resolves the named role.
source§fn resolve_item(
&self,
_: &PartialObjectName
) -> Result<&dyn CatalogItem, CatalogError>
fn resolve_item(
&self,
_: &PartialObjectName
) -> Result<&dyn CatalogItem, CatalogError>
Resolves a partially-specified item name. Read more
source§fn resolve_function(
&self,
_: &PartialObjectName
) -> Result<&dyn CatalogItem, CatalogError>
fn resolve_function(
&self,
_: &PartialObjectName
) -> Result<&dyn CatalogItem, CatalogError>
Performs the same operation as
SessionCatalog::resolve_item
but for
functions within the catalog.source§fn resolve_cluster<'a, 'b>(
&'a self,
_: Option<&'b str>
) -> Result<&'a dyn CatalogCluster<'_>, CatalogError>
fn resolve_cluster<'a, 'b>(
&'a self,
_: Option<&'b str>
) -> Result<&'a dyn CatalogCluster<'_>, CatalogError>
Resolves the named cluster. Read more
source§fn try_get_item(&self, _: &GlobalId) -> Option<&dyn CatalogItem>
fn try_get_item(&self, _: &GlobalId) -> Option<&dyn CatalogItem>
Gets an item by its ID.
source§fn item_exists(&self, _: &QualifiedObjectName) -> bool
fn item_exists(&self, _: &QualifiedObjectName) -> bool
Reports whether the specified type exists in the catalog.
source§fn get_cluster(&self, _: ClusterId) -> &dyn CatalogCluster<'_>
fn get_cluster(&self, _: ClusterId) -> &dyn CatalogCluster<'_>
Gets a cluster by ID.
source§fn resolve_full_name(&self, _: &QualifiedObjectName) -> FullObjectName
fn resolve_full_name(&self, _: &QualifiedObjectName) -> FullObjectName
Returns a fully qualified human readable name from fully qualified non-human readable name
source§fn config(&self) -> &CatalogConfig
fn config(&self) -> &CatalogConfig
Returns the configuration of the catalog.
source§fn now(&self) -> EpochMillis
fn now(&self) -> EpochMillis
Returns the number of milliseconds since the system epoch. For normal use
this means the Unix epoch. This can safely be mocked in tests and start
at 0.
source§fn find_available_name(&self, name: QualifiedObjectName) -> QualifiedObjectName
fn find_available_name(&self, name: QualifiedObjectName) -> QualifiedObjectName
Finds a name like
name
that is not already in use. Read moresource§fn aws_privatelink_availability_zones(&self) -> Option<BTreeSet<String>>
fn aws_privatelink_availability_zones(&self) -> Option<BTreeSet<String>>
Returns the set of supported AWS PrivateLink availability zone ids.
source§fn active_database_name(&self) -> Option<&str>
fn active_database_name(&self) -> Option<&str>
Returns the database to use if one is not explicitly specified.
Auto Trait Implementations§
impl RefUnwindSafe for DummyCatalog
impl Send for DummyCatalog
impl Sync for DummyCatalog
impl Unpin for DummyCatalog
impl UnwindSafe for DummyCatalog
Blanket Implementations§
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See
RustType::into_proto
.