# SurrealDB database configuration fragment
# Conditional: when database_type == "surrealdb"

[[elements]]
default = "localhost"
help = "Hostname or IP address of SurrealDB server"
name = "surrealdb_host"
nickel_path = ["provisioning", "database", "surrealdb", "host"]
prompt = "SurrealDB host"
required = true
type = "text"
when = "database_type == surrealdb"

[[elements]]
custom_type = "u16"
default = "8000"
help = "Port number for SurrealDB server"
maximum = "65535"
minimum = "1024"
name = "surrealdb_port"
nickel_path = ["provisioning", "database", "surrealdb", "port"]
prompt = "SurrealDB port"
required = true
type = "custom"
when = "database_type == surrealdb"

[[elements]]
help = "SurrealDB namespace"
name = "surrealdb_namespace"
nickel_path = ["provisioning", "database", "surrealdb", "namespace"]
placeholder = "myapp"
prompt = "Namespace"
required = true
type = "text"
when = "database_type == surrealdb"

[[elements]]
help = "SurrealDB database name"
name = "surrealdb_database"
nickel_path = ["provisioning", "database", "surrealdb", "database"]
placeholder = "main"
prompt = "Database name"
required = true
type = "text"
when = "database_type == surrealdb"

[[elements]]
default = "root"
help = "SurrealDB username for authentication"
name = "surrealdb_username"
nickel_path = ["provisioning", "database", "surrealdb", "username"]
prompt = "Database username"
required = true
type = "text"
when = "database_type == surrealdb"

[[elements]]
help = "SurrealDB password (min 8 characters)"
name = "surrealdb_password"
nickel_path = ["provisioning", "database", "surrealdb", "password"]
prompt = "Database password"
required = true
type = "password"
when = "database_type == surrealdb"

[[elements]]
default = "http"
help = "Protocol for connecting to SurrealDB"
name = "surrealdb_protocol"
nickel_path = ["provisioning", "database", "surrealdb", "protocol"]
options = ["http", "https", "ws", "wss"]
prompt = "Connection protocol"
required = true
type = "select"
when = "database_type == surrealdb"
