[−][src]Struct wdinfo::postgresql::PostgreSQL

pub struct PostgreSQL {
    pub conn: Client,
}

PostgreSQL

Fields

conn: Client

Implementations

impl PostgreSQL[src]

pub fn new(
    host: String,
    username: String,
    password: String,
    database: String
) -> Result<Self, &'static str>
[src]

customer connection

* You can provide:
  * host as string
  * username as string
  * password as string
  * database as string

Trait Implementations

impl Default for PostgreSQL[src]

fn default() -> Self[src]

default method

* Use postgres::Client::connect method
* PostgreSQL database installed in 192.168.1.213

impl SQL for PostgreSQL[src]

fn execute_queries_no_return(&mut self, qry: &str) -> Result<(), &'static str>[src]

fn check_table_exists(
    &mut self,
    skm: &str,
    tbl: &str
) -> Result<bool, &'static str>
[src]

check if table exist

* Return bool
* need schema and table name as argument

fn drop_table(&mut self, skm: &str, tbl: &str) -> Result<(), &'static str>[src]

drop table

* need schema and table name as argument

fn truncate_table(&mut self, skm: &str, tbl: &str) -> Result<(), &'static str>[src]

truncate table

* need schema and table name as argument

fn create_table(
    &mut self,
    skm: &str,
    tbl: &str,
    tbl_str: &str
) -> Result<(), &'static str>
[src]

create table

* need schema, table name, and table structure (String) as argument

fn import_data(
    &mut self,
    skm: &str,
    tbl: &str,
    datastring: String
) -> Result<(), &'static str>
[src]

import data into PostgreSQL table

* need query and data string as argument

fn execute_query_with_return(
    &mut self,
    qry: &str
) -> Result<Vec<String>, &'static str>
[src]

submit query and catch the output

* output is vector of String with [tab] as delimiter
* Leave it to be handled by the following code

Auto Trait Implementations

impl !RefUnwindSafe for PostgreSQL[src]

impl Send for PostgreSQL[src]

impl !Sync for PostgreSQL[src]

impl Unpin for PostgreSQL[src]

impl !UnwindSafe for PostgreSQL[src]

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, 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<T> UnsafeAny for T where
    T: Any, 

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