Skip to content

Commit

Permalink
feat: Add models crate (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
szinn authored Aug 13, 2024
1 parent 6486b58 commit 131950f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"crates/rust-arch",
"crates/arch-api",
"crates/arch-core",
"crates/arch-core-models",
"crates/arch-db",
"crates/arch-utils",
]
Expand Down
12 changes: 12 additions & 0 deletions crates/arch-core-models/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "arch-core-models"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true

[dependencies]
14 changes: 14 additions & 0 deletions crates/arch-core-models/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
1 change: 1 addition & 0 deletions crates/arch-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub async fn create_database_connection(url: &str) -> Result<Arc<DatabaseReposit
apply_migrations(&database).await?;

let database = Arc::new(DatabaseRepository { database });
tracing::debug!("...connected to database");

Ok(database)
}

0 comments on commit 131950f

Please sign in to comment.