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

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

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

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

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