[−][src]Struct quaint::single::Quaint
The main entry point and an abstraction over a database connection.
Methods
impl Quaint
[src]
pub async fn new<'_>(url_str: &'_ str) -> Result<Self>
[src]
Create a new connection to the database. The connection string follows the specified format:
connector_type://user:password@host/database?parameters
Connector type can be one of the following:
sqlite
/file
opens an SQLite connectionmysql
opens a MySQL connectionpostgres
/postgresql
opens a PostgreSQL connection
All parameters should be given in the query string format:
?key1=val1&key2=val2
. All parameters are optional.
SQLite:
user
/password
do not do anything and can be emitted.host
should point to the database file.db_name
parameter should give a name to the database attached for query namespacing.
PostgreSQL:
sslmode
eitherdisable
,prefer
orrequire
. Read moresslcert
should point to a PEM certificate file.sslidentity
should point to a PKCS12 certificate database.sslpassword
the password to open the PKCS12 database.sslaccept
eitherstrict
oraccept_invalid_certs
. If strict, the certificate needs to be valid and in the CA certificates.accept_invalid_certs
accepts any certificate from the server and can lead to weakened security. Defaults tostrict
.schema
the default search path.host
additionally the host can be given as a parameter, typically in cases when connectiong to the database through a unix socket to separate the database name from the database path, such aspostgresql:///dbname?host=/var/run/postgresql
.
MySQL:
sslcert
should point to a PEM certificate file.sslidentity
should point to a PKCS12 certificate database.sslpassword
the password to open the PKCS12 database.sslaccept
eitherstrict
oraccept_invalid_certs
. If strict, the certificate needs to be valid and in the CA certificates.accept_invalid_certs
accepts any certificate from the server and can lead to weakened security. Defaults tostrict
.socket
needed when connecting to MySQL database through a unix socket. When set, the host parameter is dismissed.
pub fn connection_info(&self) -> &ConnectionInfo
[src]
Info about the connection and underlying database.
Trait Implementations
impl Queryable for Quaint
[src]
ⓘImportant traits for DBIO<'a, T>fn execute<'a>(&'a self, q: Query<'a>) -> DBIO<'a, Option<Id>>
[src]
ⓘImportant traits for DBIO<'a, T>
ⓘImportant traits for DBIO<'a, T>fn query<'a>(&'a self, q: Query<'a>) -> DBIO<'a, ResultSet>
[src]
ⓘImportant traits for DBIO<'a, T>
ⓘImportant traits for DBIO<'a, T>fn query_raw<'a>(
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue]
) -> DBIO<'a, ResultSet>
[src]
ⓘImportant traits for DBIO<'a, T>
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue]
) -> DBIO<'a, ResultSet>
ⓘImportant traits for DBIO<'a, T>fn execute_raw<'a>(
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue]
) -> DBIO<'a, u64>
[src]
ⓘImportant traits for DBIO<'a, T>
&'a self,
sql: &'a str,
params: &'a [ParameterizedValue]
) -> DBIO<'a, u64>
ⓘImportant traits for DBIO<'a, T>fn raw_cmd<'a>(&'a self, cmd: &'a str) -> DBIO<'a, ()>
[src]
ⓘImportant traits for DBIO<'a, T>
ⓘImportant traits for DBIO<'a, T>fn select<'a>(&'a self, q: Select<'a>) -> DBIO<'a, ResultSet>
[src]
ⓘImportant traits for DBIO<'a, T>
ⓘImportant traits for DBIO<'a, T>fn insert<'a>(&'a self, q: Insert<'a>) -> DBIO<'a, Option<Id>>
[src]
ⓘImportant traits for DBIO<'a, T>
ⓘImportant traits for DBIO<'a, T>fn update<'a>(&'a self, q: Update<'a>) -> DBIO<'a, ()>
[src]
ⓘImportant traits for DBIO<'a, T>
ⓘImportant traits for DBIO<'a, T>fn delete<'a>(&'a self, q: Delete<'a>) -> DBIO<'a, ()>
[src]
ⓘImportant traits for DBIO<'a, T>
impl TransactionCapable for Quaint
[src]
ⓘImportant traits for DBIO<'a, T>fn start_transaction(&self) -> DBIO<Transaction>
[src]
ⓘImportant traits for DBIO<'a, T>
Auto Trait Implementations
impl !RefUnwindSafe for Quaint
impl Send for Quaint
impl Sync for Quaint
impl Unpin for Quaint
impl !UnwindSafe for Quaint
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,