Skip to main content

SidPrerequisiteHome

Enum SidPrerequisiteHome 

Source
pub enum SidPrerequisiteHome {
    Ambient,
    Schema(&'static str),
}
Expand description

Where the objects a prerequisite installs actually live, so that something calling them from another schema can name them.

Most engines need no answer. Their prerequisite installs nothing with a name — a session setting, an extension registered for the whole database, a server-global function — or installs the key function itself, which Razeri already creates and calls in a known schema. Those say Ambient and their scripts are what they were, byte for byte.

Schema is for an engine where a routine resolves an unqualified name in the schema that OWNS the routine rather than in the session’s. There, a hash installed wherever the deploy happened to sign in is invisible to every key function created in a design’s own schema — measured on Oracle as ORA-00904: "RAZERI_XXH64": invalid identifier, once, with every function beneath it then ORA-06575 … in an invalid state. Naming the home fixes the helper in one place and lets every call site spell it.

Variants§

§

Ambient

Wherever the deploy runs — the default, and the honest answer for an engine with no schema for a function at all.

SQLite loads a library into each connection; MySQL and MariaDB register a library for the whole server; ClickHouse’s CREATE FUNCTION takes no qualifier; DuckDB loads an extension into the session. None of them has a schema to put a helper in, and a call site that invented one would name an object that does not exist.

§

Schema(&'static str)

A schema Razeri owns, named here, which the prerequisite creates and installs into and which every call site then qualifies with.

Use RAZERI_HELPER_SCHEMA unless your engine reserves that word: one home for one engine-level helper is the point, and two dialects naming two homes would be two places to look.

What answering this promises. The prerequisite’s own text creates its objects IN that schema, and makes them callable from outside it — on an engine with privileges, that means the grant travels with the install. Razeri writes the schema’s own creation in front of the install, in whatever this engine’s CREATE SCHEMA spelling is, and qualifies the hash in every key function it composes.

Implementations§

Source§

impl SidPrerequisiteHome

Source

pub const fn schema(self) -> Option<&'static str>

The schema this home names, or None where there is none to name.

Trait Implementations§

Source§

impl Clone for SidPrerequisiteHome

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SidPrerequisiteHome

Source§

impl Debug for SidPrerequisiteHome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SidPrerequisiteHome

Source§

impl PartialEq for SidPrerequisiteHome

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SidPrerequisiteHome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.