Skip to main content

DatabaseWarning

Enum DatabaseWarning 

Source
pub enum DatabaseWarning {
Show 17 variants MissingRelation { query_name: String, sql_source: String, }, MissingFunction { mutation_name: String, sql_source: String, }, MissingTypeSource { type_name: String, sql_source: String, }, MissingAdditionalView { query_name: String, view_name: String, }, MissingJsonColumn { query_name: String, sql_source: String, column_name: String, }, WrongJsonColumnType { query_name: String, sql_source: String, column_name: String, actual_type: String, }, MissingPaginationColumn { query_name: String, sql_source: String, column_name: String, }, MissingIdentityColumn { query_name: String, sql_source: String, pk_column: String, }, SelfOrderingView { query_name: String, sql_source: String, }, MissingCursorColumn { query_name: String, sql_source: String, column_name: String, }, MissingJsonKey { query_name: String, type_name: String, sql_source: String, json_column: String, field_name: String, json_key: String, field_required: bool, }, NativeColumnFallback { query_name: String, sql_source: String, arg_name: String, }, UnresolvableFilter { query_name: String, sql_source: String, filter: QueryFilter, key: String, reason: InjectMiss, }, TypeConvertibility { query_name: String, sql_source: String, arg_name: String, graphql_type: String, column_type: String, }, TemporalKeyInDocument { query_name: String, sql_source: String, field: String, column: String, remedy: TemporalKeyRemedy, }, TviewIndexMissing { query_name: String, tview: String, keys: Vec<String>, options: Value, }, NativeKeyDisagreement { query_name: String, sql_source: String, column: String, json_column: String, sampled: u64, disagreeing: u64, },
}
Expand description

A single database validation warning.

Variants§

§

MissingRelation

L1: sql_source relation does not exist.

Fields

§query_name: String

Name of the query or mutation.

§sql_source: String

The sql_source value that was not found.

§

MissingFunction

L1: a mutation’s sql_source function does not exist.

Distinct from MissingRelation: a mutation’s sql_source names a SQL function (the runtime calls SELECT * FROM fn(...)), not a view/table, so it is probed via pg_proc rather than the relation catalog.

Fields

§mutation_name: String

Name of the mutation.

§sql_source: String

The sql_source function that was not found.

§

MissingTypeSource

L1: a @fraiseql.type’s declared sql_source view does not exist (#653).

Most often an embedded value object the SDK gave a synthesized v_<name> source by naming convention (a view that was never authored). Advisory only — it never fails the compile; the hard FRAISEQL_VALIDATE_SQL_SOURCES gate deliberately does not probe type sources (it would drown in synthesized-source noise), so this warn-grade path under --database is the only place phantom type sources surface.

Fields

§type_name: String

Name of the type.

§sql_source: String

The sql_source view that was not found.

§

MissingAdditionalView

L1: additional_view does not exist.

Fields

§query_name: String

Name of the query.

§view_name: String

The view name that was not found.

§

MissingJsonColumn

L2: jsonb_column does not exist on the relation.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§column_name: String

The missing column name.

§

WrongJsonColumnType

L2: jsonb_column exists but is not a JSON/JSONB type.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§column_name: String

The column name.

§actual_type: String

The actual SQL data type.

§

MissingPaginationColumn

L2: an authored pagination_order column does not exist on the relation (#1303).

The same shape as MissingCursorColumn and error-grade for the same reason: the column is rendered into ORDER BY, so a name the relation does not carry is a query that fails at request time, on a route that compiled cleanly.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§column_name: String

The missing column name.

§

MissingIdentityColumn

L2: the query’s pages are ordered by the type’s identity, and its relation exposes neither pk_<type> nor an id column to order them by (#1569).

An error: ADR-0017 makes id a base column of every read table and view, and the identity is never read out of the document, so the compiled ORDER BY would fail at the first paged read.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§pk_column: String

The pk_<type> column that would have been used had it existed.

§

SelfOrderingView

L2: the view carries its own ORDER BY and the query did not declare pagination_order = "none" (#1303).

The one case where ordering pages by the entity identity is a regression: a self-ordering view is the compiler’s own documented remedy for order_by = false, and a default ordering replaces the author’s order rather than adding to it. Advisory rather than error-grade because pg_get_viewdef cannot tell a top-level ORDER BY from one inside a subquery or window frame, where imposing a page order is entirely correct — so this reports a suspicion, and the author resolves it by declaring either way.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source view.

§

MissingCursorColumn

L2: relay_cursor_column does not exist on the relation.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§column_name: String

The missing cursor column name.

§

MissingJsonKey

L3: a JSON key path is declared but not found in sampled data.

Fields

§query_name: String

Name of the query.

§type_name: String

The GraphQL type that declares the field (where to fix it).

§sql_source: String

The sql_source relation.

§json_column: String

The JSON column being sampled.

§field_name: String

The GraphQL field name.

§json_key: String

The snake_case key looked up in the JSON.

§field_required: bool

Whether the field is declared non-nullable. A required field’s key cannot legitimately be absent from every sampled row, so this drives the finding’s Severity: required → error, nullable → warning.

§

NativeColumnFallback

L2: a direct query argument has no matching native column — will fall back to JSONB extraction.

For best performance, consider adding a native column with the same name and an index on the sql_source table/view.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§arg_name: String

The argument name that has no matching native column.

§

UnresolvableFilter

A filter the query’s relation cannot provide — an inject_params key (#1382) or a direct argument (#1394): no column of that name, and no sampled data row carrying it — so the predicate is false for every row and every caller gets an empty, successful answer.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§filter: QueryFilter

What filters the relation.

§key: String

The column / JSON key the runtime reads for it.

§reason: InjectMiss

Why the relation cannot provide it.

§

TypeConvertibility

L2: a direct query argument resolves to a native column whose SQL type cannot cleanly drive the predicate for the argument’s GraphQL scalar type (e.g. an Int argument filtering a uuid column — WHERE col = $N errors or never matches).

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§arg_name: String

The argument name.

§graphql_type: String

The argument’s declared GraphQL type (e.g. Int).

§column_type: String

The native column’s SQL type (e.g. uuid).

§

TemporalKeyInDocument

L2: a query sorts or filters a DateTime, Date or Time field it reads out of its relation’s document (#1571). The runtime compares (data->>'key')::timestamptz, a cast PostgreSQL will not index (it depends on the session’s TimeZone), so every sort or filter on the key reads every row. A native column of the type, mapped by an argument of the field’s name, is read instead, and an index on it serves both.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§field: String

The field, as the schema names it.

§column: String

The column the runtime would read for it.

§remedy: TemporalKeyRemedy

What would let an index serve the field.

§

TviewIndexMissing

L2: a query filters a TVIEW’s document on keys no index of the TVIEW serves (#1571): its inject parameters and arguments that read data->>'key', on every call. pg_tviews keeps an index declared with the TVIEW (its indexes option) over its rebuilds.

Fields

§query_name: String

Name of the query.

§tview: String

The TVIEW’s table, schema-qualified.

§keys: Vec<String>

The document keys it filters on, in the index’s order.

§options: Value

The TVIEW’s options with the index added: the whole declaration a replace must pass, since one without indexes drops them.

§

NativeKeyDisagreement

L3 (#1579): a query is scoped by an inject_params column that is a native column of its relation, its type publishes the key as a field, and sampled rows hold a different value in the column than in the document. The root read filters on the column and an embedded document of the type on the key: they must agree.

Fields

§query_name: String

Name of the query.

§sql_source: String

The sql_source relation.

§column: String

The native column, and the document key of the same name.

§json_column: String

The JSON column holding the document.

§sampled: u64

Rows sampled.

§disagreeing: u64

Rows whose column and key differ.

Implementations§

Source§

impl DatabaseWarning

Source

pub fn statement(&self) -> Option<String>

For TviewIndexMissing: the statement that declares the index with the TVIEW, keeping its definition and its other options. None for any other warning.

Source§

impl DatabaseWarning

Source

pub const fn severity(&self) -> Severity

The severity of this finding under compile --database (#384).

Error-severity drift fails the compile (unless --allow-drift): the declared schema names database objects that do not exist or cannot serve the declared shape, so the first query/mutation against them fails at runtime. Warn-severity findings are advisory:

  • MissingTypeSource is warn-grade by design (#653): synthesized value-object sources would drown a hard gate.
  • MissingJsonKey is sampling-based; a nullable field may legitimately be unset in every sampled row, so only a required field’s absent key is an error.
  • NativeColumnFallback is a performance advisory — the JSONB path is correct, just slower.

Trait Implementations§

Source§

impl Debug for DatabaseWarning

Source§

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

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

impl Display for DatabaseWarning

Source§

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

Formats the value using the given formatter. Read more

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> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

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

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

fn to_compact_string(&self) -> CompactString

Converts the given value to a CompactString. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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