pub struct LibsqlConfig { /* private fields */ }Expand description
Validated remote libSQL configuration.
The token is zeroized when the configuration is dropped and is never included in Debug.
The vendor client keeps its own copy for the lifetime of the provider; this crate cannot
zeroize that copy. Endpoints, tokens, and SQL are not retained in error values.
Implementations§
Source§impl LibsqlConfig
impl LibsqlConfig
Sourcepub fn remote(endpoint: impl Into<String>, token: impl Into<String>) -> Self
pub fn remote(endpoint: impl Into<String>, token: impl Into<String>) -> Self
Creates a configuration for a secure libsql:// or https:// endpoint.
Construction defers URL validation until LibsqlPoolProvider::connect. Use
Self::plaintext_loopback for a disposable local sqld listener.
Sourcepub fn plaintext_loopback(
endpoint: impl Into<String>,
token: impl Into<String>,
) -> Result<Self, DbError>
pub fn plaintext_loopback( endpoint: impl Into<String>, token: impl Into<String>, ) -> Result<Self, DbError>
Creates a cleartext configuration for a numeric loopback host only.
The endpoint must use http:// and a numeric loopback IP address. A host name such as
localhost is rejected because name resolution can leave the loopback interface. This is
for a disposable local server and is never selected automatically.
§Errors
Returns InvalidArgument unless the URL is cleartext, numeric loopback, and otherwise valid.
Sourcepub fn max_connections(self, count: u32) -> Self
pub fn max_connections(self, count: u32) -> Self
Sets the maximum number of concurrently acquired sessions. The default is eight.
Sourcepub fn acquire_timeout(self, timeout: Duration) -> Self
pub fn acquire_timeout(self, timeout: Duration) -> Self
Bounds waiting for a session permit and for the initial connectivity check. The default is five seconds.