use parking_lot::RwLock;
use crate::{Cursor, Result, Rows, oci::*, stmt::cols::Columns};
impl<'a> Cursor<'a> {
pub fn rows(&self) -> Result<Rows<'_>> {
if self.cols.get().is_none() {
let cols = Columns::new(Ptr::from(self.as_ref()), Ptr::from(self.as_ref()), Ptr::from(self.as_ref()), self.max_long)?;
self.cols.get_or_init(|| RwLock::new(cols));
};
Ok( Rows::from_cursor(OCI_SUCCESS, self) )
}
}