pub struct CatalogState {
    database_by_name: BTreeMap<String, DatabaseId>,
    database_by_id: BTreeMap<DatabaseId, Database>,
    entry_by_id: BTreeMap<GlobalId, CatalogEntry>,
    ambient_schemas_by_name: BTreeMap<String, SchemaId>,
    ambient_schemas_by_id: BTreeMap<SchemaId, Schema>,
    temporary_schemas: HashMap<u32, Schema>,
    compute_instances_by_id: HashMap<ComputeInstanceId, ComputeInstance>,
    compute_instances_by_name: HashMap<String, ComputeInstanceId>,
    roles: HashMap<String, Role>,
    config: CatalogConfig,
    oid_counter: u32,
}

Fields

database_by_name: BTreeMap<String, DatabaseId>database_by_id: BTreeMap<DatabaseId, Database>entry_by_id: BTreeMap<GlobalId, CatalogEntry>ambient_schemas_by_name: BTreeMap<String, SchemaId>ambient_schemas_by_id: BTreeMap<SchemaId, Schema>temporary_schemas: HashMap<u32, Schema>compute_instances_by_id: HashMap<ComputeInstanceId, ComputeInstance>compute_instances_by_name: HashMap<String, ComputeInstanceId>roles: HashMap<String, Role>config: CatalogConfigoid_counter: u32

Implementations

Computes the IDs of any indexes that transitively depend on this catalog entry.

Computes the IDs of any log sources this catalog entry transitively depends on.

source

pub fn get_entry(&self, id: &GlobalId) -> &CatalogEntry

source

pub fn try_get_entry_in_schema(
    &self,
    name: &QualifiedObjectName,
    conn_id: u32
) -> Option<&CatalogEntry>

source

fn get_entry_in_system_schemas(&self, item: &str) -> &CatalogEntry

Gets an entry named item from exactly one of system schemas.

Panics
  • If item is not an entry in any system schema
  • If more than one system schema has an entry named item.
source

pub fn try_get_entry(&self, id: &GlobalId) -> Option<&CatalogEntry>

Returns all indexes on the given object and compute instance known in the catalog.

Try inserting/updating the status of a compute instance process as described by the given event.

This method returns true if the insert was successful. It returns false if the insert was unsuccessful, i.e., the given compute instance replica is not found.

This treatment of non-existing replicas allows us to gracefully handle scenarios where we receive status updates for replicas that we have already removed from the catalog.

Try getting the status of the given compute instance process.

This method returns None if no status was found for the given compute instance process because:

  • The given compute instance replica is not found. This can occur if we already dropped the replica from the catalog, but we still receive status updates.
  • The given replica process is not found. This is the case when we receive the first status update for a new replica process.

Gets the schema map for the database matching database_spec.

Optimized lookup for a builtin table

Panics if the builtin table doesn’t exist in the catalog

Optimized lookup for a builtin log

Panics if the builtin log doesn’t exist in the catalog

Optimized lookup for a builtin object

Panics if the builtin object doesn’t exist in the catalog

Resolves PartialObjectName into a CatalogEntry.

If name does not specify a database, the current_database is used. If name does not specify a schema, then the schemas in search_path are searched in order.

source

pub fn resolve_entry(
    &self,
    current_database: Option<&DatabaseId>,
    search_path: &Vec<(ResolvedDatabaseSpecifier, SchemaSpecifier)>,
    name: &PartialObjectName,
    conn_id: u32
) -> Result<&CatalogEntry, SqlCatalogError>

Resolves name to a non-function CatalogEntry.

Resolves name to a function CatalogEntry.

Serializes the catalog’s in-memory state.

There are no guarantees about the format of the serialized state, except that the serialized state for two identical catalogs will compare identically.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request

Upcasts this ProgressEventTimestamp to Any. Read more

Returns the name of the concrete type of this object. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more