Skip to content

Commit

Permalink
[db] Add Db::exec() function #33 (#34)
Browse files Browse the repository at this point in the history
* Update db_test.rs

* Update db.rs
  • Loading branch information
michaelvlach authored Aug 19, 2022
1 parent b1b9fa9 commit 64413bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/db.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
use crate::{Query, QueryResult};

#[derive(Default)]
pub struct Db {}

impl Db {
pub fn exec(&self, _query: Query) -> QueryResult {
QueryResult::default()
}
}
7 changes: 7 additions & 0 deletions tests/db_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ extern crate agdb;
fn db_is_public_type() {
let _db = agdb::Db::default();
}

#[test]
fn exec_takes_query_returns_query_result() {
let db = agdb::Db::default();
let query = agdb::Query::default();
let _result: agdb::QueryResult = db.exec(query);
}

0 comments on commit 64413bf

Please sign in to comment.