pub struct AppConfig {Show 28 fields
pub db_uri: String,
pub db_schemas: Vec<String>,
pub db_anon_role: Option<String>,
pub db_pool_size: u32,
pub db_pool_timeout: u64,
pub db_prepared_statements: bool,
pub db_extra_search_path: Vec<String>,
pub db_channel: String,
pub db_channel_enabled: bool,
pub db_pre_request: Option<String>,
pub db_max_rows: Option<i64>,
pub db_aggregates_enabled: bool,
pub server_host: String,
pub server_port: u16,
pub server_unix_socket: Option<String>,
pub admin_server_port: Option<u16>,
pub jwt_secret: Option<String>,
pub jwt_secret_is_base64: bool,
pub jwt_aud: Option<String>,
pub jwt_role_claim_key: String,
pub jwt_cache_enabled: bool,
pub jwt_cache_max_lifetime: u64,
pub openapi_server_proxy_uri: Option<String>,
pub openapi_mode: OpenApiMode,
pub log_level: LogLevel,
pub role_settings: HashMap<String, RoleSettings>,
pub app_settings: HashMap<String, String>,
pub compat_mode: bool,
}Expand description
Main application configuration.
Fields§
§db_uri: StringPostgreSQL connection URI
db_schemas: Vec<String>Schemas to expose via the API
db_anon_role: Option<String>Role for unauthenticated requests
db_pool_size: u32Connection pool size
db_pool_timeout: u64Pool acquisition timeout in seconds
db_prepared_statements: boolUse prepared statements
db_extra_search_path: Vec<String>Extra search path schemas
db_channel: StringLISTEN/NOTIFY channel for schema reload
db_channel_enabled: boolEnable NOTIFY-based schema cache reload
db_pre_request: Option<String>Pre-request function to call
db_max_rows: Option<i64>Maximum rows allowed in a response
db_aggregates_enabled: boolEnable aggregate functions
server_host: StringServer host to bind
server_port: u16Server port
server_unix_socket: Option<String>Unix socket path (alternative to host/port)
admin_server_port: Option<u16>Admin server port (for health checks)
jwt_secret: Option<String>JWT secret key (or JWKS URL)
jwt_secret_is_base64: boolJWT secret as base64
jwt_aud: Option<String>JWT audience claim to validate
jwt_role_claim_key: StringJWT claim that contains the role
jwt_cache_enabled: boolCache JWT validations
jwt_cache_max_lifetime: u64JWT cache max entries
openapi_server_proxy_uri: Option<String>OpenAPI server URL
openapi_mode: OpenApiModeOpenAPI mode: disabled, follow-privileges, ignore-privileges, security-definer
log_level: LogLevelLog level: crit, error, warn, info, debug
role_settings: HashMap<String, RoleSettings>Per-role settings (isolation level, timeout)
app_settings: HashMap<String, String>App-level settings to expose via GUC
compat_mode: boolPostgREST compatibility mode.
When enabled, the REST surface is also served at the root (so canonical
PostgREST paths like /rpc/<name> and /<table> work in addition to
the /api-prefixed paths), and RPC responses are un-wrapped to match
PostgREST’s shape (bare object/scalar for non-set-returning functions,
a top-level array for set-returning ones) instead of the array-wrapped,
function-name-keyed default.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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