pub fn query(environment: &Environment, opt: &QueryOpt) -> Result<(), Error> {
    let QueryOpt {
        connect_opts,
        output,
        parameters,
        query,
        batch_size,
        batches_per_file,
    } = opt;

    // Convert the input strings into parameters suitable to for use with ODBC.
    let params: Vec<_> = parameters
        .iter()
        .map(|param| param.into_parameter())
        .collect();

    let odbc_conn = open_connection(&environment, connect_opts)?;

    if let Some(cursor) = odbc_conn.execute(query, params.as_slice())? {
        cursor_to_parquet(cursor, output, *batch_size, *batches_per_file)?;
    } else {
        eprintln!(
            "Query came back empty (not even a schema has been returned). No file has been created"
        );
    }
    Ok(())
}
/// Execute a query and writes the result to parquet.
Execute a query and writes the result to parquet.
Execute a query and writes the result to parquet .
pub fn query(environment: &Environment, opt: &QueryOpt) -> Result<(), Error> {
    let QueryOpt {
        connect_opts,
        output,
        parameters,
        query,
        batch_size,
        batches_per_file,
    } = opt;
    // Convert the input strings into parameters suitable to for use with ODBC.
    let params: Vec<_> = parameters
        .iter()
        .map(|param| param.into_parameter())
        .collect();
    let odbc_conn = open_connection(&environment, connect_opts)?;
    if let Some(cursor) = odbc_conn.execute(query, params.as_slice())? {
        cursor_to_parquet(cursor, output, *batch_size, *batches_per_file)?;
    } else {
        eprintln!(
            "Query came back empty (not even a schema has been returned). No file has been created"
        );
    }
    Ok(())
}
pub fn query ( environment : & Environment , opt : & QueryOpt ) -> Result < ( ) , Error > { let QueryOpt { connect_opts , output , parameters , query , batch_size , batches_per_file , } = opt ; // Convert the input strings into parameters suitable to for use with ODBC. let params : Vec < _ > = parameters . iter ( ) . map ( | param | param . into_parameter ( ) ) . collect ( ) ; let odbc_conn = open_connection ( & environment , connect_opts ) ? ; if let Some ( cursor ) = odbc_conn . execute ( query , params . as_slice ( ) ) ? { cursor_to_parquet ( cursor , output , * batch_size , * batches_per_file ) ? ; } else { eprintln ! ( " " ) ; } Ok ( ( ) ) }
Execute a query and writes the result to parquet.
Execute a query and writes the result to parquet .
environment
&Environment
opt
&QueryOpt
environment
&Environment
opt
&QueryOpt