# SQLite database configuration fragment
# Conditional: when database_type == "sqlite"

[[elements]]
type = "text"
name = "sqlite_database_path"
prompt = "Database file path"
help = "Path to SQLite database file (will be created if it doesn't exist)"
default = "./data/app.db"
nickel_path = ["provisioning", "database", "sqlite", "database_path"]
required = true
when = "database_type == sqlite"

[[elements]]
type = "select"
name = "sqlite_journal_mode"
prompt = "Journal mode"
help = "SQLite journaling mode (WAL is recommended for concurrency)"
options = ["WAL", "DELETE", "TRUNCATE", "PERSIST", "MEMORY"]
default = "WAL"
nickel_path = ["provisioning", "database", "sqlite", "journal_mode"]
required = true
when = "database_type == sqlite"

[[elements]]
type = "select"
name = "sqlite_synchronous"
prompt = "Synchronous mode"
help = "SQLite synchronous mode (NORMAL balances safety and speed)"
options = ["OFF", "NORMAL", "FULL", "EXTRA"]
default = "NORMAL"
nickel_path = ["provisioning", "database", "sqlite", "synchronous"]
required = true
when = "database_type == sqlite"

[[elements]]
type = "confirm"
name = "sqlite_foreign_keys"
prompt = "Enable foreign key constraints?"
help = "Enable SQLite foreign key enforcement"
default = true
nickel_path = ["provisioning", "database", "sqlite", "foreign_keys"]
required = true
when = "database_type == sqlite"
