Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Stream<Row> in API #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

members = [
"rdbc",
"rdbc-mysql",
"rdbc-postgres",
"rdbc-sqlite",
# "rdbc-mysql",
# "rdbc-postgres",
# "rdbc-sqlite",
# "rdbc-odbc",
"rdbc-cli",
]
1 change: 1 addition & 0 deletions rdbc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ license = "Apache-2.0"
edition = "2018"

[dependencies]
tokio = { version="0.2.9", features=["full"] }
8 changes: 7 additions & 1 deletion rdbc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
//! }
//! ```

use tokio::stream::Stream;

/// RDBC Error
#[derive(Debug)]
pub enum Error {
Expand Down Expand Up @@ -74,12 +76,16 @@ pub trait Statement {

/// Result set from executing a query against a statement
pub trait ResultSet {
type RowsStream: Stream<dyn Row>;

/// get meta data about this result set
fn meta_data(&self) -> Result<Box<dyn ResultSetMetaData>>;

/// Move the cursor to the next available row if one exists and return true if it does
fn next(&mut self) -> bool;
fn rows(&mut self) -> Result<Self::RowsStream>;
}

trait Row {
fn get_i8(&self, i: u64) -> Result<Option<i8>>;
fn get_i16(&self, i: u64) -> Result<Option<i16>>;
fn get_i32(&self, i: u64) -> Result<Option<i32>>;
Expand Down