# Database Configuration - Default (SQLite)
# syntaxis
#
# This is the DEFAULT configuration using SQLite.
# For SurrealDB, see database-surrealdb.toml
# For production guidance, see SURREALDB_SETUP_GUIDE.md

[database]
engine = "sqlite"
description = "Local SQLite database (recommended for development)"

# ============================================================================
# SQLITE CONFIGURATION (Default Backend)
# ============================================================================

[sqlite]
# Database file path
# Supports tilde expansion (~) and environment variables
path = "~/.local/share/core/workspace.db"

# Connection pool settings
max_connections = 5
timeout_secs = 30

# SQLite optimizations
wal_mode = true                  # Write-Ahead Logging for better concurrency
pragma_synchronous = "NORMAL"    # Faster writes with acceptable durability
pragma_cache_size = 2000         # 2000 pages cache (8MB on 4KB pages)

# Additional optimizations (optional)
# pragma_journal_mode = "WAL"
# pragma_temp_store = "MEMORY"   # Use memory for temp tables

# ============================================================================
# SURREALDB CONFIGURATION (Disabled - Uncomment to enable)
# ============================================================================

# To enable SurrealDB, uncomment the following section and update the engine line above
# See SURREALDB_SETUP_GUIDE.md for setup instructions

# [surrealdb]
# # Connection URL - choose one:
#
# # Option 1: Embedded in-memory (no server needed, fast for testing)
# url = "mem://"
#
# # Option 2: Embedded file-based (no server needed, persistent)
# # url = "file:///tmp/surrealdb.db"
#
# # Option 3: Remote server via WebSocket (requires: surreal start)
# # url = "ws://localhost:8000"
#
# # Option 4: Remote server via HTTP
# # url = "http://localhost:8000"
#
# # Namespace and database selection
# namespace = "syntaxis"
# database = "projects"
#
# # Authentication (only if server started with --username/--password)
# # username = "admin"
# # password = "${SURREALDB_PASSWORD}"  # Use environment variable for security
#
# # Connection pooling
# max_connections = 10
# timeout_secs = 60
#
# # TLS Configuration (for production)
# # tls_enabled = false
# # tls_ca_cert = "/path/to/ca.pem"
# # tls_client_cert = "/path/to/client.pem"
# # tls_client_key = "/path/to/client.key"

# ============================================================================
# NOTES
# ============================================================================
#
# SQLite (default):
# - Single-file database: ~/.local/share/core/workspace.db
# - No server required
# - Good for: Local development, single-user scenarios
# - Limitations: Limited concurrency for high-traffic scenarios
#
# SurrealDB (optional):
# - Modern multi-backend database
# - Supports multiple deployment modes (embedded, server, cloud)
# - Good for: Production, scaling, advanced queries
# - Requires: Server mode setup or embedded library
#
# For production deployment guidance:
# See: SURREALDB_SETUP_GUIDE.md
#
# For database migration:
# See: SURREALDB_2_3_MIGRATION.md

