Expand description
Types, values and errors. The bottom of the workspace.
Rank 0 in the layer rule, which means everything can see this crate and this crate can see
nothing. See xtask/layers.toml and spec/18-package-layout.md.
What lives here is the vocabulary every other crate spells its signatures in. A type, a single value, an error, a span into the query text that produced it, and the token that says a running query should stop. Nothing here knows what a vector is, what a plan is or what a file is, and keeping it that way is what stops rank 0 from becoming a second name for the whole database.
Cancel is here for the layer rule rather than because it is a kind of value. The thing that
sets it is the embedding API at rank 13 and the thing that reads it is the executor at rank 12,
so the only place both can see it from is the bottom. The slow counter is here for the same
reason: the two things that increment it are at rank 1 and rank 3, the thing that reads it is at
rank 4, and no two of those three can see each other. So is the stage clock, which is
written at rank 5 by the Parquet reader and read at rank 4 by the same shim. So is Session,
which is filled in at rank 13 by whatever ran SET and read at rank 12 by duckdb_settings().
Stat is here for the same reason and it is the widest case of it. A statistic is produced by
the storage layer at rank 5, by the catalog at rank 8 and by an operator at rank 12 that has just
finished its build side, and it is consumed by the optimizer at rank 11 and by most of those
again, so the only place all of them can spell the answer is the bottom. Rules follows it,
because a switch that turns a rule off has to be readable wherever the rule fires.
Re-exports§
pub use bounds::Bound;pub use bounds::Op;pub use bounds::excluded;pub use cancel::Cancel;pub use error::Error;pub use error::ErrorCode;pub use error::Result;pub use error::Span;pub use memory::ALLOCATION;pub use memory::Memory;pub use memory::Reservation;pub use memory::human;pub use rules::Rule;pub use rules::Rules;pub use rules::looks_like_rule;pub use rules::rule_names;pub use session::DefaultNullOrder;pub use session::IdentifierCase;pub use session::Semantics;pub use session::Session;pub use session::SessionTimeZone;pub use session::ShowBehavior;pub use slow::Cause;pub use slow::Tally;pub use stage::Spent;pub use stage::Stage;pub use stat::Class;pub use stat::Classes;pub use stat::Source;pub use stat::Stat;pub use types::Field;pub use types::LogicalType;pub use types::MAX_DECIMAL_WIDTH;pub use types::PhysicalType;pub use value::Value;pub use value::civil_from_days;pub use value::days_from_civil;pub use value::interval_micros;
Modules§
- bounds
- What a minimum and a maximum can answer about a comparison, without looking at any rows.
- cancel
- Stopping a query that is already running.
- error
- The error model.
- memory
- How much memory a query is allowed to hold.
- rules
- The switches that turn one optimization off, and the two that turn a whole layer off.
- session
- What a session has set, for the tables and functions that read a setting back.
- slow
- How many times this thread took a path written to be correct rather than fast.
- stage
- Where an operator’s time went, split by the phase inside it that spent it.
- stat
- What the statistics layer answers with, and how much of it is safe to believe.
- types
- The type system, per
spec/10-sql-and-types.mdsection 10.1. - utf8
- Whether a run of bytes is text, answered in one pass.
- value
- Single values.