[−][src]Struct wdinfo::postgresql::PostgreSQL
PostgreSQL
- Connect to PostgreSQL
- Execute queries to PostgreSQL
- import data into PostgreSQL
Fields
conn: ClientImplementations
impl PostgreSQL[src]
pub fn new(
host: String,
username: String,
password: String,
database: String
) -> Result<Self, &'static str>[src]
host: String,
username: String,
password: String,
database: String
) -> Result<Self, &'static str>
customer connection
* You can provide: * host as string * username as string * password as string * database as string
Trait Implementations
impl Default for PostgreSQL[src]
Default initialization of PostgreSQL
- use as defalt
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]
&mut self,
skm: &str,
tbl: &str
) -> Result<bool, &'static str>
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]
&mut self,
skm: &str,
tbl: &str,
tbl_str: &str
) -> Result<(), &'static str>
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]
&mut self,
skm: &str,
tbl: &str,
datastring: String
) -> Result<(), &'static str>
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]
&mut self,
qry: &str
) -> Result<Vec<String>, &'static str>
submit query and catch the output
* output is vector of String with [tab] as delimiter * Leave it to be handled by the following code
fn create_truncate_table(
&mut self,
skm: &str,
tbl: &str,
tbl_str: &str
) -> Result<(), &'static str>[src]
&mut self,
skm: &str,
tbl: &str,
tbl_str: &str
) -> Result<(), &'static str>
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]
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,
pub 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,