diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-25 15:07:40 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-25 15:07:40 +0000 |
| commit | 5ad9d9093fcbe7037e5474a9d8fa20a0b64fb79a (patch) | |
| tree | 3c22fb4b42a62badedc29963d1ce39a2fbc83bb1 /src | |
| parent | 4fc3b279d3eb86993f7748959a3986be5a6c49a7 (diff) | |
drop nostr-db backend support, keep only lmdb and memory
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.rs | 4 | ||||
| -rw-r--r-- | src/nostr/builder.rs | 10 |
2 files changed, 0 insertions, 14 deletions
diff --git a/src/config.rs b/src/config.rs index dd7b1e3..5c9303c 100644 --- a/src/config.rs +++ b/src/config.rs | |||
| @@ -280,8 +280,6 @@ pub enum DatabaseBackend { | |||
| 280 | /// LMDB backend (persistent, general purpose) | 280 | /// LMDB backend (persistent, general purpose) |
| 281 | #[default] | 281 | #[default] |
| 282 | Lmdb, | 282 | Lmdb, |
| 283 | /// NostrDB backend (persistent, optimized for Nostr) | ||
| 284 | NostrDb, | ||
| 285 | /// In-memory database (fastest, no persistence - uses temp directory for git data) | 283 | /// In-memory database (fastest, no persistence - uses temp directory for git data) |
| 286 | Memory, | 284 | Memory, |
| 287 | } | 285 | } |
| @@ -290,7 +288,6 @@ impl std::fmt::Display for DatabaseBackend { | |||
| 290 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 288 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 291 | match self { | 289 | match self { |
| 292 | Self::Memory => write!(f, "memory"), | 290 | Self::Memory => write!(f, "memory"), |
| 293 | Self::NostrDb => write!(f, "nostrdb"), | ||
| 294 | Self::Lmdb => write!(f, "lmdb"), | 291 | Self::Lmdb => write!(f, "lmdb"), |
| 295 | } | 292 | } |
| 296 | } | 293 | } |
| @@ -821,7 +818,6 @@ mod tests { | |||
| 821 | #[test] | 818 | #[test] |
| 822 | fn test_database_backend_display() { | 819 | fn test_database_backend_display() { |
| 823 | assert_eq!(DatabaseBackend::Memory.to_string(), "memory"); | 820 | assert_eq!(DatabaseBackend::Memory.to_string(), "memory"); |
| 824 | assert_eq!(DatabaseBackend::NostrDb.to_string(), "nostrdb"); | ||
| 825 | assert_eq!(DatabaseBackend::Lmdb.to_string(), "lmdb"); | 821 | assert_eq!(DatabaseBackend::Lmdb.to_string(), "lmdb"); |
| 826 | } | 822 | } |
| 827 | 823 | ||
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index 7a05348..a0088e1 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs | |||
| @@ -689,16 +689,6 @@ pub async fn create_relay( | |||
| 689 | max_events: Some(NonZeroUsize::new(100_000).unwrap()), | 689 | max_events: Some(NonZeroUsize::new(100_000).unwrap()), |
| 690 | })) | 690 | })) |
| 691 | } | 691 | } |
| 692 | DatabaseBackend::NostrDb => { | ||
| 693 | tracing::info!("Using NostrDB backend at: {}", db_path.display()); | ||
| 694 | // TODO: Implement NostrDB backend once nostr-relay-builder supports it | ||
| 695 | // For now, fall back to memory database | ||
| 696 | tracing::warn!("NostrDB backend not yet implemented, using in-memory database"); | ||
| 697 | Arc::new(MemoryDatabase::with_opts(MemoryDatabaseOptions { | ||
| 698 | events: true, | ||
| 699 | max_events: Some(NonZeroUsize::new(100_000).unwrap()), | ||
| 700 | })) | ||
| 701 | } | ||
| 702 | DatabaseBackend::Lmdb => { | 692 | DatabaseBackend::Lmdb => { |
| 703 | tracing::info!("Using LMDB backend at: {}", db_path.display()); | 693 | tracing::info!("Using LMDB backend at: {}", db_path.display()); |
| 704 | // Ensure the database directory exists | 694 | // Ensure the database directory exists |