aboutsummaryrefslogtreecommitdiff
path: root/src/main/rust/store/mod.rs
diff options
context:
space:
mode:
authorKevin Hoerr <kjhoerr@submelon.dev>2026-02-25 22:28:26 +0000
committerKevin Hoerr <kjhoerr@submelon.dev>2026-02-25 22:28:26 +0000
commit8a4f311c1d1fa4d978c93e58d95bf59a8a38b587 (patch)
tree2d0b2c526d4bc25ba048664e77519cf278702a37 /src/main/rust/store/mod.rs
parentd96b45f468a1587fd0ba1e8ecd0552478d7e6f90 (diff)
downloadequity-tracker-8a4f311c1d1fa4d978c93e58d95bf59a8a38b587.tar.gz
equity-tracker-8a4f311c1d1fa4d978c93e58d95bf59a8a38b587.tar.bz2
equity-tracker-8a4f311c1d1fa4d978c93e58d95bf59a8a38b587.zip
Add context and initialization
Diffstat (limited to 'src/main/rust/store/mod.rs')
-rw-r--r--src/main/rust/store/mod.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/rust/store/mod.rs b/src/main/rust/store/mod.rs
new file mode 100644
index 0000000..42f1809
--- /dev/null
+++ b/src/main/rust/store/mod.rs
@@ -0,0 +1,32 @@
+pub mod sqlite;
+
+use miette::Result;
+
+pub enum Context {
+ SQLite(sqlite::SQLite),
+}
+
+impl Default for Context {
+ fn default() -> Self {
+ Context::SQLite(sqlite::SQLite::default())
+ }
+}
+
+pub trait Store {
+ fn init(&mut self) -> Result<()>;
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn context_default() {
+ let context = Context::default();
+
+ let res = match context {
+ Context::SQLite(_) => true,
+ };
+ assert!(res);
+ }
+}