pub struct SchemaConfig {
pub exposed_schemas: Vec<String>,
pub enable_mutations: bool,
pub enable_subscriptions: bool,
pub query_prefix: Option<String>,
pub query_suffix: Option<String>,
pub use_camel_case: bool,
pub max_rows: Option<i64>,
}Expand description
Configuration for schema generation.
Fields§
§exposed_schemas: Vec<String>Schemas to expose in GraphQL (e.g., [“public”])
enable_mutations: boolWhether to generate mutation types
enable_subscriptions: boolWhether to generate subscription types
query_prefix: Option<String>Prefix for query fields (e.g., “all” -> “allUsers”)
query_suffix: Option<String>Suffix for query fields (e.g., “Collection” -> “usersCollection”)
use_camel_case: boolWhether to use camelCase for field names
max_rows: Option<i64>Ceiling on rows a single query may return (PGRST_MAX_ROWS).
Applied when a query supplies no limit of its own, and as an upper
bound when it supplies a larger one. None leaves queries unbounded.
Implementations§
Source§impl SchemaConfig
impl SchemaConfig
Sourcepub fn with_schemas(self, schemas: Vec<String>) -> Self
pub fn with_schemas(self, schemas: Vec<String>) -> Self
Set the exposed schemas.
Sourcepub fn with_mutations(self, enable: bool) -> Self
pub fn with_mutations(self, enable: bool) -> Self
Enable or disable mutations.
Sourcepub fn with_subscriptions(self, enable: bool) -> Self
pub fn with_subscriptions(self, enable: bool) -> Self
Enable or disable subscriptions.
Sourcepub fn is_schema_exposed(&self, schema: &str) -> bool
pub fn is_schema_exposed(&self, schema: &str) -> bool
Check if a schema is exposed.
Sourcepub fn default_schema(&self) -> &str
pub fn default_schema(&self) -> &str
The schema whose tables get unqualified GraphQL names.
This is the first exposed schema, mirroring how the REST surface treats
the first entry of PGRST_DB_SCHEMAS as the default.
Trait Implementations§
Source§impl Clone for SchemaConfig
impl Clone for SchemaConfig
Source§fn clone(&self) -> SchemaConfig
fn clone(&self) -> SchemaConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaConfig
impl Debug for SchemaConfig
Auto Trait Implementations§
impl Freeze for SchemaConfig
impl RefUnwindSafe for SchemaConfig
impl Send for SchemaConfig
impl Sync for SchemaConfig
impl Unpin for SchemaConfig
impl UnsafeUnpin for SchemaConfig
impl UnwindSafe for SchemaConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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