# ===========================================
# MCP SQL Server - Environment Variables
# ===========================================
# -------------------------------------------
# SQL Server Connection
# -------------------------------------------
# You can configure the connection in TWO ways:
#
# OPTION 1: Connection URL (recommended for simplicity)
# OPTION 2: Individual parameters (for more control)
#
# If SQL_CONNECTION_URL is set, it takes precedence over
# individual parameters (SQL_SERVER, SQL_DATABASE, etc.)
# -------------------------------------------
# OPTION 1: Connection URL
# -------------------------------------------
# Format: sqlserver://user:password@host:port/database?options
#
# Supported query parameters:
# - encrypt=true|false|disable
# - TrustServerCertificate=true|false
#
# Examples:
# SQL_CONNECTION_URL=sqlserver://sa:Password123@localhost:1433/MyDatabase
# SQL_CONNECTION_URL=sqlserver://sa:Password123@localhost:1433/MyDatabase?TrustServerCertificate=true&encrypt=disable
# SQL_CONNECTION_URL=mssql://user:pass@192.168.1.100:1433/ProductionDB?encrypt=true
#
# SQL_CONNECTION_URL=sqlserver://sa:YourStrongPassword123!@localhost:1433/MyDatabase?TrustServerCertificate=true
# -------------------------------------------
# OPTION 2: Individual Parameters
# -------------------------------------------
# SQL Server host (IP address or hostname)
SQL_SERVER=localhost
# Database name
SQL_DATABASE=MyDatabase
# SQL Server authentication
SQL_USER=sa
SQL_PASSWORD=YourStrongPassword123!
# -------------------------------------------
# SQL Server Connection (OPTIONAL)
# -------------------------------------------
# These settings apply to both connection methods.
# Note: If using URL, port/encrypt/trust are parsed from the URL.
# SQL Server port (default: 1433)
SQL_PORT=1433
# Use encrypted connection (default: true)
SQL_ENCRYPT=true
# Trust self-signed certificates - use only in development (default: false)
SQL_TRUST_CERT=false
# -------------------------------------------
# Operation Mode (REQUIRED)
# -------------------------------------------
# READONLY mode controls what operations are allowed:
# true = Read-only mode (SELECT queries only)
# false = Full access mode (SELECT, INSERT, UPDATE, DELETE)
#
# The server will NOT start if this variable is not set.
READONLY=true
# -------------------------------------------
# Performance Settings (OPTIONAL)
# -------------------------------------------
# Query timeout in milliseconds (default: 30000, max: 120000)
QUERY_TIMEOUT=30000
# Maximum rows returned per query (default: 1000, max: 5000)
MAX_ROWS=1000
# Connection pool minimum connections (default: 2)
POOL_MIN=2
# Connection pool maximum connections (default: 10)
POOL_MAX=10
# -------------------------------------------
# Logging (OPTIONAL)
# -------------------------------------------
# Log level: debug, info, warn, error (default: info)
LOG_LEVEL=info