1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct DatabaseConfig {
8 #[serde(default = "default_database_url")]
10 pub url: String,
11
12 pub qdrant: Option<QdrantConfig>,
14}
15
16fn default_database_url() -> String {
17 "postgres://postgres:postgres@localhost:5432/ares".to_string()
18}
19
20impl Default for DatabaseConfig {
21 fn default() -> Self {
22 Self {
23 url: default_database_url(),
24 qdrant: None,
25 }
26 }
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
31pub struct QdrantConfig {
32 #[serde(default = "default_qdrant_url")]
34 pub url: String,
35
36 pub api_key_env: Option<String>,
38}
39
40pub fn default_qdrant_url() -> String {
41 "http://localhost:6334".to_string()
42}
43
44impl Default for QdrantConfig {
45 fn default() -> Self {
46 Self {
47 url: default_qdrant_url(),
48 api_key_env: None,
49 }
50 }
51}