Skip to content

Commit

Permalink
feat: add DB initialization module
Browse files Browse the repository at this point in the history
This provides an interface defining the methods
that we expect to be used for OV handling operations.

Added an implementation for sqlite and postgress.

Added db creation files and tests.

Signed-off-by: Irene Diez <[email protected]>
  • Loading branch information
7flying committed Oct 2, 2023
1 parent 30a7585 commit 35c3fba
Show file tree
Hide file tree
Showing 12 changed files with 775 additions and 15 deletions.
141 changes: 127 additions & 14 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"http-wrapper",
"store",
"util",
"db",

"client-linuxapp",
"owner-onboarding-server",
Expand All @@ -24,6 +25,7 @@ default-members = [
"http-wrapper",
"store",
"util",
"db",

"client-linuxapp",
"owner-onboarding-server",
Expand All @@ -33,4 +35,5 @@ default-members = [
"manufacturing-client",
"serviceinfo-api-server",
"admin-tool",
]
]

23 changes: 23 additions & 0 deletions db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "db"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0"
diesel = { version = "2.1.0", features = ["sqlite", "postgres", "r2d2"] }
dotenvy = "0.15"
log = "0.4"
time = "0.3"
xattr = { version = "1.0", default-features = false, optional = false } # We *need* xattrs to store TTL

fdo-data-formats = { path = "../data-formats", version = "0.4.12" }
fdo-util = { path = "../util", version = "0.4.12" }

[features]
postgres = []
sqlite = []

default = ["postgres", "sqlite"]
Loading

0 comments on commit 35c3fba

Please sign in to comment.