# Storage Backend Configuration Fragment
# Used by: kogral-config form

[[elements]]
border_top = true
border_bottom = false
name = "storage_section_header"
title = "💾 Storage Backend"
type = "section_header"

[[elements]]
default = "filesystem"
help = "Primary storage backend for knowledge base"
name = "storage_primary"
nickel_path = ["storage", "primary"]
options = ["filesystem", "memory", "surrealdb"]
prompt = "Primary Storage"
type = "select"

[[elements]]
default = false
help = "Enable secondary storage backend"
name = "storage_secondary_enabled"
nickel_path = ["storage", "secondary", "enabled"]
prompt = "Enable Secondary Storage"
type = "boolean"

[[elements]]
default = "surrealdb"
help = "Secondary storage type (when enabled)"
name = "storage_secondary_type"
nickel_path = ["storage", "secondary", "type"]
options = ["surrealdb", "sqlite"]
prompt = "Secondary Type"
type = "select"
visible_if = "storage_secondary_enabled == true"

[[elements]]
default = "ws://localhost:8000"
help = "Connection URL for secondary storage"
name = "storage_secondary_url"
nickel_path = ["storage", "secondary", "url"]
placeholder = "ws://localhost:8000"
prompt = "Secondary URL"
type = "text"
visible_if = "storage_secondary_enabled == true"

[[elements]]
default = "kb"
help = "SurrealDB namespace"
name = "storage_secondary_namespace"
nickel_path = ["storage", "secondary", "namespace"]
prompt = "Namespace"
type = "text"
visible_if = "storage_secondary_type == 'surrealdb'"

[[elements]]
default = "default"
help = "SurrealDB database name"
name = "storage_secondary_database"
nickel_path = ["storage", "secondary", "database"]
prompt = "Database"
type = "text"
visible_if = "storage_secondary_type == 'surrealdb'"
