pub struct PostgresConnectionOptions { /* private fields */ }Implementations§
Source§impl PostgresConnectionOptions
impl PostgresConnectionOptions
pub fn with_host(self, host: impl Into<String>) -> Self
pub fn with_port(self, port: impl Into<u16>) -> Self
pub fn with_username(self, username: impl Into<String>) -> Self
pub fn with_password(self, password: impl Into<String>) -> Self
pub fn with_database(self, database: impl Into<Option<String>>) -> Self
Source§impl PostgresConnectionOptions
impl PostgresConnectionOptions
Sourcepub fn new(
host: impl Into<String>,
port: u16,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn new( host: impl Into<String>, port: u16, username: impl Into<String>, password: impl Into<String>, ) -> Self
Examples found in repository?
examples/postgres.rs (lines 7-12)
6pub async fn main() {
7 let options = ConnectionOptions::Postgres(PostgresConnectionOptions::new(
8 "localhost",
9 5432,
10 "user",
11 "password",
12 ));
13 let remote_table = RemoteTable::try_new(options, "SELECT * from supported_data_types", None)
14 .await
15 .unwrap();
16
17 let ctx = SessionContext::new();
18 ctx.register_table("remote_table", Arc::new(remote_table))
19 .unwrap();
20
21 ctx.sql("SELECT * from remote_table")
22 .await
23 .unwrap()
24 .show()
25 .await
26 .unwrap();
27}Trait Implementations§
Source§impl Clone for PostgresConnectionOptions
impl Clone for PostgresConnectionOptions
Source§fn clone(&self) -> PostgresConnectionOptions
fn clone(&self) -> PostgresConnectionOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PostgresConnectionOptions
impl RefUnwindSafe for PostgresConnectionOptions
impl Send for PostgresConnectionOptions
impl Sync for PostgresConnectionOptions
impl Unpin for PostgresConnectionOptions
impl UnwindSafe for PostgresConnectionOptions
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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