use parking_lot::RwLock;
use crate::{Cursor, Result, Rows, oci::*, stmt::cols::Columns};
impl<'a> Cursor<'a> {
pub async fn rows(&'a self) -> Result<Rows<'a>> {
async {
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) )
}.await
}
}