<commit_before>
mod types;
mod input;
mod output;
pub use self::output::Output;
pub use self::input::InputParameter;
use {ffi, DataSource, Return, Result, Raii, Handle, Connected};
use ffi::SQLRETURN::*;
use std::marker::PhantomData;

/// `Statement` state used to represent a freshly allocated connection
pub enum Allocated {}
/// `Statement` state used to represent a statement with a result set cursor
///
/// A statement is most likely to enter this state after a `SELECT` query.
pub enum HasResult {}
/// `Statement` state used to represent a statement with no result set
///
/// A statement is likely to enter this state after executing e.g. a `CREATE TABLE` statement
type NoResult = Allocated; // pub enum NoResult {}

/// Holds a `Statement` after execution of a query.Allocated
///
/// A executed statement may be in one of two states. Either the statement has yielded a result set
/// or not. Keep in mind that some ODBC drivers just yield empty result sets on e.g. `INSERT`
/// Statements
pub enum Executed<'a, 'b> {
    Data(Statement<'a, 'b, HasResult>),
    NoData(Statement<'a, 'b, NoResult>),
}
pub use Executed::*;

/// RAII wrapper around ODBC statement
pub struct Statement<'a, 'b, S> {
    raii: Raii<ffi::Stmt>,
    // we use phantom data to tell the borrow checker that we need to keep the data source alive
    // for the lifetime of the statement
    parent: PhantomData<&'a DataSource<'a, Connected>>,
    state: PhantomData<S>,
    parameters: PhantomData<&'b [u8]>,
}

/// Used to retrieve data from the fields of a query resul
pub struct Cursor<'a, 'b: 'a, 'c : 'a> {
    stmt: &'a mut Statement<'b, 'c, HasResult>,
    buffer: [u8; 512],
}

impl<'a, 'b, S> Handle for Statement<'a, 'b, S> {
    type To = ffi::Stmt;
    unsafe fn handle(&self) -> ffi::SQLHSTMT {
        self.raii.handle()
    }
}

impl<'a, 'b, S> Statement<'a, 'b, S> {
    fn with_raii(raii: Raii<ffi::Stmt>) -> Self {
        Statement {<commit_msg>fix typo<commit_after>
mod types;
mod input;
mod output;
pub use self::output::Output;
pub use self::input::InputParameter;
use {ffi, DataSource, Return, Result, Raii, Handle, Connected};
use ffi::SQLRETURN::*;
use std::marker::PhantomData;

/// `Statement` state used to represent a freshly allocated connection
pub enum Allocated {}
/// `Statement` state used to represent a statement with a result set cursor
///
/// A statement is most likely to enter this state after a `SELECT` query.
pub enum HasResult {}
/// `Statement` state used to represent a statement with no result set
///
/// A statement is likely to enter this state after executing e.g. a `CREATE TABLE` statement
type NoResult = Allocated; // pub enum NoResult {}

/// Holds a `Statement` after execution of a query.Allocated
///
/// A executed statement may be in one of two states. Either the statement has yielded a result set
/// or not. Keep in mind that some ODBC drivers just yield empty result sets on e.g. `INSERT`
/// Statements
pub enum Executed<'a, 'b> {
    Data(Statement<'a, 'b, HasResult>),
    NoData(Statement<'a, 'b, NoResult>),
}
pub use Executed::*;

/// RAII wrapper around ODBC statement
pub struct Statement<'a, 'b, S> {
    raii: Raii<ffi::Stmt>,
    // we use phantom data to tell the borrow checker that we need to keep the data source alive
    // for the lifetime of the statement
    parent: PhantomData<&'a DataSource<'a, Connected>>,
    state: PhantomData<S>,
    parameters: PhantomData<&'b [u8]>,
}

/// Used to retrieve data from the fields of a query result
pub struct Cursor<'a, 'b: 'a, 'c : 'a> {
    stmt: &'a mut Statement<'b, 'c, HasResult>,
    buffer: [u8; 512],
}

impl<'a, 'b, S> Handle for Statement<'a, 'b, S> {
    type To = ffi::Stmt;
    unsafe fn handle(&self) -> ffi::SQLHSTMT {
        self.raii.handle()
    }
}

impl<'a, 'b, S> Statement<'a, 'b, S> {
    fn with_raii(raii: Raii<ffi::Stmt>) -> Self {
        Statement {
{'fraction_non_alphanumeric': 0.13456599897277863, 'fraction_numerical': 0.0025680534155110425, 'mean_word_length': 3.5396270396270397, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2601688', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1251, 'n_words': 507}