Skip to content

Commit

Permalink
refactor(sqlite): rename Sqlite::new() to Sqlite::in_memory() (#25)
Browse files Browse the repository at this point in the history
one has to read the new function to understand that the default behavior
is in-memory
  • Loading branch information
open-schnick authored Oct 25, 2024
1 parent 965e88f commit a95aa51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/db/sqlite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct Sqlite {
}

impl Sqlite {
pub fn new() -> Sqlite {
pub fn in_memory() -> Sqlite {
let connection = Connection::open_in_memory().unwrap();

Sqlite {
Expand Down
2 changes: 1 addition & 1 deletion tests/client/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct SetupSqlite;
#[async_trait::async_trait]
impl Setup for SetupSqlite {
async fn setup(&self, schema: Schema) -> Db {
let driver = toasty_sqlite::Sqlite::new();
let driver = toasty_sqlite::Sqlite::in_memory();
let db = toasty::Db::new(schema, driver).await;
db.reset_db().await.unwrap();
db
Expand Down

0 comments on commit a95aa51

Please sign in to comment.