[][src]Enum quaint::prelude::ConnectionInfo

pub enum ConnectionInfo {
    Postgres(PostgresUrl),
    Mysql(MysqlUrl),
    Sqlite {
        file_path: String,
        db_name: String,
    },
}

General information about a SQL connection.

Variants

Postgres(PostgresUrl)

A PostgreSQL connection URL.

Mysql(MysqlUrl)

A MySQL connection URL.

Sqlite

A SQLite connection URL.

Fields of Sqlite

file_path: String

The filesystem path of the SQLite database.

db_name: String

The name the database is bound to (with ATTACH DATABASE), if available.

Methods

impl ConnectionInfo[src]

pub fn from_url(url_str: &str) -> Result<Self>[src]

Parse ConnectionInfo out from an SQL connection string.

Will fail if URI is invalid or the scheme points to an unsupported database.

pub fn dbname(&self) -> Option<&str>[src]

The provided database name. This will be None on SQLite.

pub fn schema_name(&self) -> &str[src]

This is what item names are prefixed with in queries.

  • In SQLite, this is the schema name that the database file was attached as.
  • In Postgres, it is the selected schema inside the current database.
  • In MySQL, it is the database name.

pub fn host(&self) -> &str[src]

The provided database host. This will be "localhost" on SQLite.

pub fn username(&self) -> Option<Cow<str>>[src]

The provided database user name. This will be None on SQLite.

pub fn file_path(&self) -> Option<&str>[src]

The database file for SQLite, otherwise None.

pub fn sql_family(&self) -> SqlFamily[src]

The family of databases connected.

pub fn port(&self) -> Option<u16>[src]

The provided database port, if applicable.

pub fn database_location(&self) -> String[src]

A string describing the database location, meant for error messages. It will be the host and port on MySQL/Postgres, and the file path on SQLite.

Trait Implementations

impl Clone for ConnectionInfo[src]

impl Debug for ConnectionInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,