# SurrealDB Database Configuration Fragment
# Used by: orchestrator, control-center (when backend = surrealdb)

[[elements]]
border_top = true
border_bottom = false
name = "database_section_header"
title = "💾 SurrealDB Database Configuration"
type = "section_header"

[[elements]]
default = "surrealdb"
help = "Database backend type"
name = "database_backend"
nickel_path = ["database", "backend"]
prompt = "Database Backend"
type = "text"

[[elements]]
help = "SurrealDB server URL (e.g., http://localhost:8000 for embedded)"
name = "database_surrealdb_url"
nickel_path = ["database", "surrealdb_url"]
placeholder = "http://localhost:8000"
prompt = "SurrealDB URL"
type = "text"

[[elements]]
default = "provisioning"
help = "SurrealDB namespace"
name = "database_surrealdb_namespace"
nickel_path = ["database", "surrealdb_namespace"]
prompt = "Namespace"
type = "text"

[[elements]]
default = "default"
help = "SurrealDB database name"
name = "database_surrealdb_database"
nickel_path = ["database", "surrealdb_database"]
prompt = "Database"
type = "text"

[[elements]]
default = 10
help = "Database connection pool size (range: 1-200)"
max = 200
min = 1
name = "database_pool_size"
nickel_path = ["database", "pool_size"]
prompt = "Connection Pool Size"
type = "number"

[[elements]]
default = 30
help = "Database operation timeout in seconds (range: 10-3600)"
max = 3600
min = 10
name = "database_timeout"
nickel_path = ["database", "timeout"]
prompt = "Timeout (seconds)"
type = "number"

[[elements]]
default = 3
help = "Number of retry attempts for failed operations (range: 0-10)"
max = 10
min = 0
name = "database_retry_attempts"
nickel_path = ["database", "retry_attempts"]
prompt = "Retry Attempts"
type = "number"

[[elements]]
default = 100
help = "Delay in milliseconds between retry attempts (range: 1000-60000)"
max = 60000
min = 1000
name = "database_retry_delay"
nickel_path = ["database", "retry_delay"]
prompt = "Retry Delay (ms)"
type = "number"
